Re: why is bitmap index chosen for this query? - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: why is bitmap index chosen for this query?
Date
Msg-id 20060518155906.GA6909@uio.no
Whole thread Raw
In response to why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
Responses Re: why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
List pgsql-performance
On Thu, May 18, 2006 at 08:52:04AM -0700, Stephen Byers wrote:
> Could someone explain the results of the following?

It sounds like PostgreSQL badly overestimates the cost of the index scan.
Does the table perchance fit completely into memory, without
effective_cache_size indicating that?

> Also, what is Recheck Cond?

The bitmap index scan will by default allocate one bit per tuple. If it can't
hold a complete bitmap of every tuple in memory, it will fall back to
allocating one bit per (8 kB) page, since it will have to read the entire
page anyhow, and the most dramatic cost is the seek. However, in the latter
case, it will also get a few extra records that don't match the original
clause, so it will have to recheck the condition ("Recheck Cond") before
outputting the tuples to the parent node.

/* Steinar */
--
Homepage: http://www.sesse.net/

pgsql-performance by date:

Previous
From: Stephen Byers
Date:
Subject: why is bitmap index chosen for this query?
Next
From: "Ivan Zolotukhin"
Date:
Subject: Re: SQL CPU time usage