-----Original Message-----
From: Michael Peppler
To: Orlando Andico
Cc: Marcotullio, Angelo  ; ''[EMAIL PROTECTED] ' '
Sent: 06/26/2001 10:09 AM
Subject: RE: Shorthand for $dbh->prepare and $sth->execute?

Orlando Andico writes:
 > On Tue, 26 Jun 2001, Marcotullio, Angelo   wrote:
 > ..
 > > In Oracle, the $sth->execute() builds the cursor and waits for the
program
 > > to start fetching records.  The hints don't change this behavior,
just the
 > > access plan.
 > ..
 > 
 > Hrmmm... that's not what I've seen. I wrote some code which used
 > Time::HiRes to measure the time taken at each step.. something like
this:
 > 
 > $t0 = [gettimeofday];
 > $sth = $dbh->prepare ("SELECT * FROM TEN_MILLION_ROW_TABLE");
 > print [gettimeofday] - $t0;
 > 
 > $t0 = [gettimeofday];
 > $sth->execute;
 > # and so on..
 > 
 > and definitely, the execute part took longest.. if what you're saying
is
 > true, execute would return immediately and let me fetch records at
will.
 > That does NOT happen. execute takes forever, THEN i can fetch
records.

>That's interesting - shouldn't such a select return *very* quickly? It
>doesn't have to build a complex query plan, it just needs to follow
>the page or row chain and return the rows in any order that it wants
>to... 

I would say the same, but some here are arguing that the whole query is
fetched into an Oracle cache before execute returns, so much for speed and
efficiency.

Ilya


>Michael
-- 
Michael Peppler - Data Migrations Inc. - [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com
*Looking for new project to tackle starting 8/1/01*

Reply via email to