|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Fetchrow questionby mje (Deacon) |
| on Mar 21, 2012 at 09:04 UTC ( #960740=note: print w/ replies, xml ) | Need Help?? |
|
I see others have answered your question but I'm not sure I agree with them all. When you say "Do the $Sth->execute() read the entire table and put it into an array in memory?" if you are talking about what happens in Perl or the XS code DBD::ODBC uses the answer is no. In ODBC terms what happens (in this simplified pseudo code is like this):
What happens in the database and between the database and the ODBC driver is difficult to answer as it depends on the driver and database. For instance, with MS SQL Server using the TDS protocol then unless you've changed the default cursor, the database gathers all the rows and sends them down the socket and the driver reads whatever it decides (could be 1 row, could be multiple rows). When you use fetchall_* DBI calls fetch repeatedly in the DBD and stores the rows.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||