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.