http://qs321.pair.com?node_id=309672


in reply to DBI/mysql gathering all rows on execute

There are two possible causes, perhaps both of them at the same time:

 _  _ _  _  
(_|| | |(_|><
 _|   

Replies are listed 'Best First'.
Re: Re: DBI/mysql gathering all rows on execute
by sgifford (Prior) on Nov 24, 2003 at 21:17 UTC

    Thanks, it was $sth->{"mysql_use_result"} = 1; that I needed!

    The right indexes are all in place (and EXPLAIN SELECT agrees), there are just a huge number of rows in the result set.

    Now here's the other weird thing, which doesn't matter for my real project but is still unusual. When I make this change, the test program I posted above works better, but now it hangs for a long time during the finish. That surprises me; I would expect it to cancel the query and return immediately. Anybody know what's going on?