tadman has asked for the wisdom of the Perl Monks concerning the following question:
Maybe I'm just delusional, but I was under the impression
that when using DBI that calling using the
execute,prepare,fetch technique meant that the table was retrieved piecewise, as in one
row at a time. If you were bold enough to use something
like fetchall_arrayref() instead, then you would expect
the entire thing to appear in RAM. I haven't been able to
find any clarification on the internals of DBI with respect
to this particular aspect.
I'm doing something pretty simple on a 9M row table, and yet DBI is chomping up a good 300MB+ of RAM if you should let it run that long:
I'm doing something pretty simple on a 9M row table, and yet DBI is chomping up a good 300MB+ of RAM if you should let it run that long:
I'm not making it past the $s->execute() statement, and I don't want to make a trip to RAM Depot® for a bulk purchase.use DBI; # (Init w. AutoCommit=>1 occurs here) # Prepare the SELECT statement... my ($s) = $db->prepare ("SELECT * FROM table"); # ...and run it. my ($s_rv) = $s->execute(); # Wait patiently, run out of RAM... # Presumably, should be able to fetch data and use it here: while (my @row = $s->fetchrow_array()) { ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBI + 'SELECT *' - Memory Use Galore?
by kschwab (Vicar) on Feb 17, 2001 at 03:55 UTC | |
by tadman (Prior) on Feb 18, 2001 at 10:51 UTC | |
Re: DBI + 'SELECT *' - Memory Use Galore?
by runrig (Abbot) on Feb 17, 2001 at 02:28 UTC | |
by tadman (Prior) on Feb 17, 2001 at 03:06 UTC | |
(ichimunki) Re: DBI + 'SELECT *' - Memory Use Galore?
by ichimunki (Priest) on Feb 17, 2001 at 02:16 UTC | |
Re: DBI + 'SELECT *' - Memory Use Galore?
by xeridon (Initiate) on Feb 17, 2001 at 23:59 UTC | |
by tilly (Archbishop) on Feb 18, 2001 at 00:16 UTC |
Back to
Seekers of Perl Wisdom