From: Hell, Robert <Robert.Hell@fabasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Cursors and different settings for default_statistics_target
Date: Wed, 2 Apr 2008 12:11:06 +0200
Message-ID: <B710F3299F04664DB6B37C258FDEEB940158B255@FABAMAIL.fabagl.fabasoft.com> (raw)
In-Reply-To: <15688.1207088631@sss.pgh.pa.us>
References: <B710F3299F04664DB6B37C258FDEEB940158AFF9@FABAMAIL.fabagl.fabasoft.com>
<2798.1207063805@sss.pgh.pa.us>
<B710F3299F04664DB6B37C258FDEEB940158B0E9@FABAMAIL.fabagl.fabasoft.com>
<9629.1207066619@sss.pgh.pa.us>
<B710F3299F04664DB6B37C258FDEEB940158B0FC@FABAMAIL.fabagl.fabasoft.com>
<9999.1207068123@sss.pgh.pa.us>
<B710F3299F04664DB6B37C258FDEEB940158B11A@FABAMAIL.fabagl.fabasoft.com>
<15688.1207088631@sss.pgh.pa.us>
I'm motivated to contribute a patch for that.
I would prefer to make tuple_fraction for cursors configurable as GUC
parameter cursor_tuple_fraction.
Do you agree with that?
Regards,
Robert
-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Mittwoch, 02. April 2008 00:24
To: Hell, Robert
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Cursors and different settings for
default_statistics_target
"Hell, Robert" <Robert.Hell@fabasoft.com> writes:
> But why are the first 15 fetches (15360 rows) processed in 0.5 seconds
and the last fetch (998 rows) takes 7 seconds.
> Are we just unlucky that the last fetch takes that long?
Well, the indexscan plan is going to scan through all the rows in objid
order and return whichever of them happen to match the IN list. So I
think you're just saying that your IN list isn't uniformly dense through
the whole set of objids.
If the real story is that you tend to select only objids within a narrow
range, adding explicit "AND objid >= x AND objid <= y" constraints
(where you compute x and y on the fly from the set of objids you're
asking for) would reduce the overhead of the indexscan.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: Robert.Hell@fabasoft.com, tgl@sss.pgh.pa.us
Subject: Re: Cursors and different settings for default_statistics_target
In-Reply-To: <B710F3299F04664DB6B37C258FDEEB940158B255@FABAMAIL.fabagl.fabasoft.com>
References: <B710F3299F04664DB6B37C258FDEEB940158AFF9@FABAMAIL.fabagl.fabasoft.com> <2798.1207063805@sss.pgh.pa.us> <B710F3299F04664DB6B37C258FDEEB940158B0E9@FABAMAIL.fabagl.fabasoft.com> <9629.1207066619@sss.pgh.pa.us> <B710F3299F04664DB6B37C258FDEEB940158B0FC@FABAMAIL.fabagl.fabasoft.com> <9999.1207068123@sss.pgh.pa.us> <B710F3299F04664DB6B37C258FDEEB940158B11A@FABAMAIL.fabagl.fabasoft.com> <15688.1207088631@sss.pgh.pa.us> <B710F3299F04664DB6B37C258FDEEB940158B255@FABAMAIL.fabagl.fabasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox