Re: Cursors and different settings for default_statistics_target

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hell, Robert" <Robert(dot)Hell(at)fabasoft(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Cursors and different settings for default_statistics_target
Date: 2008-04-01 15:30:05
Message-ID: 2798.1207063805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Hell, Robert" <Robert(dot)Hell(at)fabasoft(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ioana Danes 2008-04-01 15:38:38 Insert time
Previous Message Matthew 2008-04-01 13:55:51 Re: check performance parameters