4 ms·
He'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).
by pyre 11y ago
He'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]:
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.
[1] https://github.com/kennethreitz/records/blob/master/records.py#L108 https://github.com/kennethreitz/records/blob/master/records....
[2] https://github.com/kennethreitz/records/blob/master/records.py#L82 https://github.com/kennethreitz/records/blob/master/records....
[3] http://initd.org/psycopg/docs/usage.html#server-side-cursors http://initd.org/psycopg/docs/usage.html#server-side-cursors