http://www.perlmonks.org?node_id=309662


in reply to DBI/mysql gathering all rows on execute

If the execute is taking a long time, I would suggest putting something like a LIMIT ?, OFFSET ? at the end of your query, insert useful values into the appropriate placeholders (shudder) and use that approach to break the query up into bite-sized chunks. That should limit memory consumption.

--t. alex
Life is short: get busy!

Replies are listed 'Best First'.
Re: Re: DBI/mysql gathering all rows on execute
by jdtoronto (Prior) on Nov 24, 2003 at 20:33 UTC
    This method can be problematic. If there is any other activity on the table then the results will not be returned in the same order on succesive accesses and so you have a chance of missing some records completely or getting some twice. It is in fact possible, but not common, for consecutive executes to return the recirds in a different order even when no other activity has taken place on the table, particularly when using Perl 5.8.1 or later.

    jdtoronto