Re: [pysqlite] Concurrency problems? Writer contention?

Gerhard Häring <[email protected]> Wed, 04 Mar 2009 10:01:24 +0100
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Roger Binns wrote:
> Gerhard Häring wrote:
>> Maybe
>> I'll even switch to eager reading (client-side cursors) by default. I'm
>> thinking about a configurable parameter like Connection.prefetch_rows
>> (default 1000 or so).
> 
> You probably want to limit the prefetch by memory consumption rather
> than rows.  There could be blobs, large amounts of text etc.

Yes, I thought about that, too. Any idea how? Probably just call some
size functions() and accumulate ...

The big disadvantage is that the behaviour (prefetch or no prefetch) is
less predictable for the user this way.

I think there are basically two use cases for pysqlite:

single user: there's no reason why you would want to prefetch.

multi user: web applications etc.: generally it makes sense to prefetch
to avoid locks.

Also, web applications typically don't query loads of data. If there are
too many rows, they tend to use LIMIT/OFFSET anyway.

-- Gerhard