I'm using: DBD-mysql-2.9004 DBI-1.47 (and Apache::DBI)
Good question about MySQL cursors... I looked through the DBD::Mysql docs and didn't find anything about cursors. So this means that if you query the whole table ("select * from ....") then you need to have as much RAM as the size of the table! (?!) I suppose a workaround would be to do multiple select's for different key ranges, and print out each subset iteratively. JB On 9/22/05, Malcolm J Harwood <[EMAIL PROTECTED]> wrote: > On Thursday 22 September 2005 11:06 am, Jeff Ambrosino wrote: > > > I'm exporting a database table through a mod_perl2 handler. The > > problem is that for large tables, the size of the httpd process > > balloons to consume alot of RAM. For example, a 299mb MySQL table > > (size of .MYD file), which creates a 35mb export, causes httpd to > > consume about 220mb of RAM! > > > > My code is fairly straightforward, so I must be missing something > > about buffering or > > > > while ( my $rowref = $sth->fetchrow_arrayref ) { > > $r->print $rowref->[0]; > > # ...more $r->print statements for each field... > > } > > Does it do the same thing if you don't print anything? I believe some of the > DBD's cache the entire result set rather than getting it a chunk at a time. > Which dbd are you using?