Ticket #10291: 10291.diff

File 10291.diff, 1.3 KB (added by Erin Kelly, 15 years ago)
  • docs/ref/models/querysets.txt

     
    940940~~~~~~~~~~~~~~
    941941
    942942Evaluates the ``QuerySet`` (by performing the query) and returns an
    943 `iterator`_ over the results. A ``QuerySet`` typically reads all of
    944 its results and instantiates all of the corresponding objects the
    945 first time you access it; ``iterator()`` will instead read results and
    946 instantiate objects in discrete chunks, yielding them one at a
    947 time. For a ``QuerySet`` which returns a large number of objects, this
    948 often results in better performance and a significant reduction in
    949 memory use.
     943`iterator`_ over the results. A ``QuerySet`` typically caches its
     944results internally so that repeated evaluations do not result in
     945additional queries; ``iterator()`` will instead read results directly,
     946without doing any caching at the ``QuerySet`` level. For a
     947``QuerySet`` which returns a large number of objects, this often
     948results in better performance and a significant reduction in memory
     949use.
    950950
    951951Note that using ``iterator()`` on a ``QuerySet`` which has already
    952952been evaluated will force it to evaluate again, repeating the query.
Back to Top