Re: Idea how to get rid of Bitmap Heap Scan - Mailing list pgsql-performance

From Matthew Wakeling
Subject Re: Idea how to get rid of Bitmap Heap Scan
Date
Msg-id alpine.DEB.2.00.0912181548380.31626@aragorn.flymine.org
Whole thread Raw
In response to Idea how to get rid of Bitmap Heap Scan  ("Michael N. Mikhulya" <m.mikhulya@gmail.com>)
Responses Re: Idea how to get rid of Bitmap Heap Scan  ("Michael N. Mikhulya" <m.mikhulya@gmail.com>)
List pgsql-performance
On Fri, 18 Dec 2009, Michael N. Mikhulya wrote:
> The problem here is that we are forced to fetch "files" in Bitmap Heap Scan.
> But actually there is no need for the whole "files" record. The
> necessary data is only "files" ids.
>
> The idea is to avoid fetching data from "files" table, and get the ids
> from index! (probably it is a little bit tricky, but it is a
> performance area...)

Unfortunately, the index does not contain enough information to accomplish
this. This is due to Postgres' advanced concurrency control system.
Postgres needs to fetch the actual rows from the files table in order to
check whether that row is visible in the current transaction, and a Bitmap
Index Scan is the fastest way to do this.

You can speed this up in Postgres 8.4 by having a RAID array and setting
the effective_concurrency configuration to the number of spindles in the
RAID array, or by having gobs of RAM and keeping everything in cache.

Matthew

--
 A good programmer is one who looks both ways before crossing a one-way street.
 Considering the quality and quantity of one-way streets in Cambridge, it
 should be no surprise that there are so many good programmers there.

pgsql-performance by date:

Previous
From: "Michael N. Mikhulya"
Date:
Subject: Idea how to get rid of Bitmap Heap Scan
Next
From: Sigurgeir Gunnarsson
Date:
Subject: Re: Issues with \copy from file