pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bitmap Index Scan optimization opportunity
Date: Fri, 10 Aug 2007 21:05:13 +0100
Message-ID: <46BCC4F9.70903@enterprisedb.com> (raw)
In-Reply-To: <46BC7737.EE98.0025.0@wicourts.gov>
References: <46BC7737.EE98.0025.0@wicourts.gov>

Kevin Grittner wrote:
> These query times are the "fully cached" times for both, from doing a previous run of the same query.  (The first one took 193.772 ms on its first run; I don't have a good "uncached" timing for the second one at this point.)
>  
> It seems like the first query could move the searchName filter to the Bitmap Index Scan phase, and save 97.5% of the page retrievals in the Bitmap Heap Scan.

Yes it could in theory, but unfortunately the planner/executor doesn't
have the capability to do that. An indexed value is never handed back
from the index; the indexed values are only used to satisfy index
conditions, not filters. It's been discussed before (see
http://archives.postgresql.org/pgsql-performance/2006-09/msg00080.php),
but it's not easy to implement so no one's done it yet.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com



view thread (2+ messages)

Message-ID: <46BCC4F9.70903@enterprisedb.com>
Permalink:  ../46BCC4F9.70903@enterprisedb.com/
Also on:    postgresql.org/message-id/46BCC4F9.70903@enterprisedb.com

 · 

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: heikki@enterprisedb.com, Kevin.Grittner@wicourts.gov
  Subject: Re: Bitmap Index Scan optimization opportunity
  In-Reply-To: <46BCC4F9.70903@enterprisedb.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