Re: Re: Use generators instead of lists for resultsets?
PFC <[email protected]> Sun, 26 Jun 2005 18:25:40 +0200
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Organization | La Boutique Numérique |
| Message-ID | <op.sszjw2thth1vuj@localhost> |
Pardon the intrusion ;) I'd say that - if the result set is large, people are using database cursors anyway (SQL cursors not Python cursors) and FETCH command. - if the result set is small, like in most queries, one call to fetchall() probably is faster than many calls to fetchone() and the memory overhead is very small - some database drivers fetch the entire result set at once anyway (postgres for instance) because they rightfully consider that you're using a CURSOR anyway if you want to fetch a lot of stuff. - delaying the processing on the client side will use precious database server resources for a longer time. ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click