On Tue, Jun 26, 2001 at 09:09:36AM -0700, Michael Peppler wrote:
> >
> > $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...
One other point about DBD::Oracle is that by default it sets up a row
cache and the initial 'execute and fetch' single Oracle OCI API call
will actually 'execute and fetch enough rows to fill the row cache'.
Benchmarks are tricky things.
Tim.