He&#x27;s using cursors directly from the his database library[1] which is psycopg2[2] (and we can also see that the cursor_factory is how the dicts are generated). The psycopg2 docs say[3]:<p><pre><code>  When a database query is executed, the Psycopg cursor usually
  fetches all the records returned by the backend, transferring
  them to the client process. If the query returned an huge amount
  of data, a proportionally large amount of memory will be
  allocated by the client.
</code></pre>
[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;kennethreitz&#x2F;records&#x2F;blob&#x2F;master&#x2F;records.py#L108" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kennethreitz&#x2F;records&#x2F;blob&#x2F;master&#x2F;records....</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;kennethreitz&#x2F;records&#x2F;blob&#x2F;master&#x2F;records.py#L82" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kennethreitz&#x2F;records&#x2F;blob&#x2F;master&#x2F;records....</a><p>[3] <a href="http:&#x2F;&#x2F;initd.org&#x2F;psycopg&#x2F;docs&#x2F;usage.html#server-side-cursors" rel="nofollow">http:&#x2F;&#x2F;initd.org&#x2F;psycopg&#x2F;docs&#x2F;usage.html#server-side-cursors</a>