title: How can I iterate over a large table without loading all into memory?
body: <p>I am trying to iterate over a really large table.</p>
  
  <pre><code>iter(self.session.query(Trade).order_by(Trade.time).yield_per(1))
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for t in self.session.query(Trade).order_by(Trade.time).yield_per(1):
      prev = t
  </code></pre>
  
  <p>blocks until the computer crashes because it runs out of memory. yield_per(1) doesn't seem to do anything. How can I iterate over a large table without loading all into memory at once?</p>