pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Gary Doades <gpd@gpdnet.co.uk>
Cc: pgsql-performance@postgresql.org
Subject: Re: planner/optimizer question
Date: Fri, 30 Apr 2004 14:48:32 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0404301439590.29884@leary.csoft.net> (raw)
In-Reply-To: <4092A928.27720.19838422@localhost>
References: <409207D6.17204.170D5A52@localhost>
	<4092A928.27720.19838422@localhost>



On Fri, 30 Apr 2004, Gary Doades wrote:

> Yes, you're right and I have done this just to prove to myself that it
> is the index scan that is the bottleneck. I have some complex SQL that
> executes very quickly with Postgres, similar to MSSQL, but the index
> scans in most of those only touch a few rows for a few loops. It seems
> to be a problem when the index scan is scanning very many rows and for
> each of these it has to go to the table just to find out if the index it
> just looked at is still valid.
> 

Another way to speed this up is the TODO item: "Use bitmaps to fetch 
heap pages in sequential order"  For an indexscan that fetches a number 
of rows those rows may be anywhere in the base table so as each index 
entry is found it fetches the corresponding table row from the heap.  This 
is not ideal because you can be jumping around in the heap and end up 
fetching the same page multiple times because table rows are in the same 
page, but were found in different places in the index.

Kris Jurka



view thread (37+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0404301439590.29884@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0404301439590.29884@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0404301439590.29884@leary.csoft.net

 · 

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 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: books@ejurka.com, gpd@gpdnet.co.uk
  Subject: Re: planner/optimizer question
  In-Reply-To: <Pine.BSO.4.56.0404301439590.29884@leary.csoft.net>
  References: <409207D6.17204.170D5A52@localhost> <4092A928.27720.19838422@localhost> <Pine.BSO.4.56.0404301439590.29884@leary.csoft.net>

* 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