pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hell, Robert <Robert.Hell@fabasoft.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Cursors and different settings for default_statistics_target
Date: Tue, 01 Apr 2008 18:23:51 -0400
Message-ID: <15688.1207088631@sss.pgh.pa.us> (raw)
In-Reply-To: <B710F3299F04664DB6B37C258FDEEB940158B11A@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>

"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



view thread (10+ messages)  latest in thread

Message-ID: <15688.1207088631@sss.pgh.pa.us>
Permalink:  ../15688.1207088631@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15688.1207088631@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Robert.Hell@fabasoft.com
  Subject: Re: Cursors and different settings for default_statistics_target
  In-Reply-To: <15688.1207088631@sss.pgh.pa.us>

* 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