On Fri, Dec 21, 2012 at 1:52 AM, Johannes Bauer <dfnsonfsdu...@gmx.de> wrote:
> def fetchmanychks(cursor):
>         cursor.execute("SELECT id FROM foo;")
>         while True:
>                 result = cursor.fetchmany()
>                 if len(result) == 0:
>                         break
>                 for x in result:
>                         yield x

I'm not familiar with sqlite, but from working with other databases,
I'm wondering if possibly your commits are breaking the fetchmany.

Would it spoil your performance improvements to do all the fetchmany
calls before yielding anything? Alternatively, can you separate the
two by opening a separate database connection for the foo-reading (so
it isn't affected by the commit)?

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to