Steve McLellan <smclellan(at)mintel(dot)com> writes:
> Thanks! Installing 8.4 and setting cursor_tuple_fraction to 1.0 does seem to
> force it to execute in the same time as not using the cursor, and we'll
> probably go with this solution (the only reason we're using cursors is to
> avoid retrieving vast result sets through psycopg2/fetchmany). Your
> explanation makes sense, and I'm curious to see why this particular query
> ends up being so different, but I couldn't figure out how to run the explain
> - the DECLARE syntax doesn't seem to allow it.
"EXPLAIN [ANALYZE] DECLARE x CURSOR ..." works for me.
regards, tom lane