From a4bbbb6e664e605634cb3f9e0564c7e4a93697be Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 24 Jul 2013 09:07:39 +0200 Subject: sqlalchemy's fetchmany defaults to being fetchall This voids the benefits of processing rows during row generation as has been observed on postgres. --- dedup/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dedup') diff --git a/dedup/utils.py b/dedup/utils.py index e4d1c10..6864ad3 100644 --- a/dedup/utils.py +++ b/dedup/utils.py @@ -1,11 +1,11 @@ import sqlalchemy.event def fetchiter(cursor): - rows = cursor.fetchmany() + rows = cursor.fetchmany(1024) while rows: for row in rows: yield row - rows = cursor.fetchmany() + rows = cursor.fetchmany(1024) def enable_sqlite_foreign_keys(engine): @sqlalchemy.event.listens_for(engine, "connect") -- cgit v1.2.3