0

some code like below:

session.query(MODEL).all()

it will return all items with the type list

this means that, it will take a lots memory if there are a large amount items?

How can i got a iterable object, but not list.

Yueyoum
  • 2,823
  • 5
  • 23
  • 26
  • 1
    http://stackoverflow.com/questions/7389759/memory-efficient-built-in-sqlalchemy-iterator-generator – dm03514 Dec 04 '12 at 15:20

1 Answers1

0

Year, not use all() , and the result is a generator

and thanks @dm03514

Yueyoum
  • 2,823
  • 5
  • 23
  • 26