Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: DBI/mysql gathering all rows on execute

by talexb (Chancellor)
on Nov 24, 2003 at 20:12 UTC ( #309662=note: print w/replies, xml ) Need Help??

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.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309662]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2023-04-01 04:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found