Re: [pysqlite] Concurrency problems? Writer contention?

Roger Binns <[email protected]> Wed, 04 Mar 2009 02:42:03 -0800
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gerhard Häring wrote:
> Yes, I thought about that, too. Any idea how? Probably just call some
> size functions() and accumulate ...

It just needs to be approximately right - you just want to prevent
runaway memory consumption so a simple formula like 12 bytes per row
plus 12 bytes per column plus len() on any values that support it should
work.

> 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.

In that case why don't they just use fetchall?  If the developer is
going to have to be aware of the underlying implementation details in
order to make judgment calls on when to use prefetch and how many
rows/memory to use for it then why not just document fetchall.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmuWvcACgkQmOOfHg372QQD+ACguDO/3Clz9Rf80yRY/bGq6zZj
seQAoL7zYuKi1rkmEH7Uu0l7lSU9MFWW
=s1aP
-----END PGP SIGNATURE-----