Re: Re: [metabase-dev] RE: [PEAR-DEV] Re: [binarycloud-dev] FW: letstalk "metapear" - politics aside:-)
| From: | John Lim | Date: | Wed, 20 Mar 2002 06:36:32 +0000 |
| Subject: | Re: Re: [metabase-dev] RE: [PEAR-DEV] Re: [binarycloud-dev] FW: letstalk "metapear" - politics aside:-) | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5054@lists.php.net to get a copy of this message | ||
Thanks Thies,
I found out that my benchmark used:
OCIExecute($stmt)
when I should be using
OCIExecute($stmt, OCI_DEFAULT)
so it was commiting every record. Uggh.
Tested your benchmark on a sun server (editted for clarity)
timing 5000 inserts using parse
time elapsed 3.56
timing 5000 inserts using parse & bind
time elapsed 3.48
timing 5000 inserts using the same statment & bind
time elapsed 1.98
Eg. Using bind vars was nearly twice as fast.
Regards, John
"Thies C. Arntzen" <thies@thiesos.org> wrote in message
news:20020319184200.GB13320@schnuffel.thieso.net...
> On Wed, Mar 20, 2002 at 01:06:28AM +0800, John Lim wrote:
> >
> > > Query caching: Some databases, like Oracle, have a cache of parsed and
> > > optimized queries. By using prepare(), the database will need to
parse
> > > and optimize your query just once instead of every time you execute
it.
> > > This can be a really big speedup.
> > >
> > Hi Stig,
> >
> > Strangely enough, I recently benchmarked binding of variables and got
some
> > strange results. They were 6 times slower than sending pure sql.
>
> try my attached "insert_speed" benchmark. fior me it shows a
> 3,5 fold speedup using bind and reusing the statement.
>
> re,
> tc
>
>