Re: Cursors and different settings for default_statistics_target - Mailing list pgsql-performance

From Tom Lane
Subject Re: Cursors and different settings for default_statistics_target
Date
Msg-id 2798.1207063805@sss.pgh.pa.us
Whole thread Raw
In response to Cursors and different settings for default_statistics_target  ("Hell, Robert" <Robert.Hell@fabasoft.com>)
Responses Re: Cursors and different settings for default_statistics_target
List pgsql-performance
"Hell, Robert" <Robert.Hell@fabasoft.com> writes:
> When we use 20 as default_statistics_target the retrieval of the data
> takes 7.5 seconds - with 25 as default_statistics_target (with restart
> and analyze) it takes 0.6 seconds.
> The query plan is identical in both situations (row estimation differs a
> little bit) - the query is always fast when it is executed without a
> cursor.

A cursor doesn't necessarily use the same plan as a straight query does.
Try "EXPLAIN DECLARE curs_285058224 CURSOR FOR ..." and see if you
aren't getting different plans in these two cases.

            regards, tom lane

pgsql-performance by date:

Previous
From: Matthew
Date:
Subject: Re: check performance parameters
Next
From: Ioana Danes
Date:
Subject: Insert time