On Fri, Sep 07, 2007 at 03:02:09PM +0800, Ow Mun Heng wrote:
> 
> On Fri, 2007-09-07 at 14:33 +0800, Ow Mun Heng wrote:
> > Connection is to a MSSQL Server using DBI:sybase.
> 
> Found out can do DBI_profiling..
> 
> $DBI_PROFILE=1 perl mssql_fetchrowarray.pl > /dev/null
> DBI::Profile: 0.834204s 16.68% (15333 calls) mssql_fetchrowarray.pl @ 
> 2007-09-07 14:36:11
> 
> $ DBI_PROFILE=1 perl mssql_fetchrowarrayref.pl > /dev/null
> DBI::Profile: 1.077652s 21.55% (15333 calls) mssql_fetchrowarrayref.pl @ 
> 2007-09-07 14:36:20

Okay, now I'm more interested because DBI Profiling isolates the cost better.

> 'execute' => 0.249191s
> 'prepare' => 0.000489s
> 'fetchrow_arrayref' => 0.800888s / 15319 = 0.000052s avg (first 0.000633s, 
> min 0.000010s, max 0.005775s)
> 
> 'prepare' => 0.000216s
> 'execute' => 0.027413s
> 'fetchrow_array' => 0.789209s / 15319 = 0.000052s avg (first 0.001905s, min 
> 0.000025s, max 0.010331s)

Note the wildly different prepare() and execute() times between the two runs.
(I'm trusting here that the query itself is the same.)

Given that level of variability (probably due to db load and/or network
issues) you can't expect to get a meaningful comparison of the two methods.

And even if you could, it should be clear that the difference is but a
tiny fraction of the overall time spent processing the query.

Tim.

Reply via email to