[SQLObject] SQLObject SELECTs and generators
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Simon W. <cs...@ba...> - 2003-10-01 23:25:34
|
When you run a SQLObject SELECT statement and get back an array of objects matching that select, are all of the represented rows from the database loaded in to memory? If so, that could cause a great deal of memory usage for large queries. An interesting trick I saw a while ago was using generators to yield a single row from a query at a time, allowing code to iterate through a whole database result set without first having to load everything in to a Python list: http://www.halfcooked.com/mt/archives/000497.html Are there any plans to add some kind of mechanism to SQLObject to support this kind of more efficient SELECT access? Or does it exist already and I juste haven't spotted it yet. Cheers, Simon Willison http://simon.incutio.com/ |