Re: Choice of bitmap scan over index scan - Mailing list pgsql-performance

From Matthew Wakeling
Subject Re: Choice of bitmap scan over index scan
Date
Msg-id alpine.DEB.2.00.1001111029040.25000@aragorn.flymine.org
Whole thread Raw
In response to Re: Choice of bitmap scan over index scan  (Mathieu De Zutter <mathieu@dezutter.org>)
Responses Re: Choice of bitmap scan over index scan
List pgsql-performance
On Mon, 11 Jan 2010, Mathieu De Zutter wrote:
> > seq_page_cost = 0.1
> > random_page_cost = 0.1

> So if this query usually does *not* hit the cache, it will be probably faster if I leave
> it like that? While testing a query I execute it that much that it's always getting into
> the cache. However, since other applications run on the same server, I think that
> infrequently used data gets flushed after a while, even if the DB could fit in the RAM.

Postgres is being conservative. The plan it uses (bitmap index scan) will
perform much better than an index scan when the data is not in the cache,
by maybe an order of magnitude, depending on your hardware setup.

The index scan may perform better at the moment, but the bitmap index scan
is safer.

Matthew

--
 Change is inevitable, except from vending machines.

pgsql-performance by date:

Previous
From: Mathieu De Zutter
Date:
Subject: Re: Choice of bitmap scan over index scan
Next
From: Pierre Frédéric Caillaud
Date:
Subject: Re: Choice of bitmap scan over index scan