Re: [HACKERS] query plan different for "SELECT ..." and "DECLARE CURSOR ..."?

2003-10-02 Thread Tom Lane
David Blasby <[EMAIL PROTECTED]> writes: > The only real problem is that the user has to manual keep stats > up-to-date. Is there anyway to attach something to VACUUM ANALYSE? The ANALYZE code is set up with the idea that there could be multiple analysis methods and various kinds of stuff stored

Re: [HACKERS] query plan different for "SELECT ..." and "DECLARE CURSOR ..."?

2003-10-01 Thread Tom Lane
David Blasby <[EMAIL PROTECTED]> writes: > I've been noticing query planning to be different for a cursor-based > select and normal select. IIRC, in a DECLARE context the planner puts more weight on the startup cost than the total cost, on the theory that you might not be planning to fetch the wh

[HACKERS] query plan different for "SELECT ..." and "DECLARE CURSOR ..."?

2003-10-01 Thread David Blasby
I've been noticing query planning to be different for a cursor-based select and normal select. For example, my query looks like this: =# SELECT The query takes about 1/4 of a second. But, for: =# BEGIN; =# DECLARE mycursor BINARY CURSOR FOR SELECT ; =# FETCH ALL IN mycursor; The same [SQL] q