pypgsql overuses server-side cursors resulting in large performance penalty
|Reported by:||Owned by:||Christian Boos|
Most trac + postgres installs are using pyscopg2 which pulls full result sets for cursor.execute by default.
pypgsql, on the other hand, uses server-side cursors by default, leading to incredibly inefficient queries: rather than fetch e.g.
select ... limit 20 all at once, it does
declare cursor; fetch 1; fetch 1; ...
Fortunately, server-side cursors can be turned off with great results. I imagine some of pypgsql's widespread perception of slowness with Trac is due to this strange default behavior.