Re: BitMap Heap Scan & BitMap Index Scan - Mailing list pgsql-performance

From Torsten Förtsch
Subject Re: BitMap Heap Scan & BitMap Index Scan
Date
Msg-id 5283486A.7000209@gmx.net
Whole thread Raw
In response to BitMap Heap Scan & BitMap Index Scan  (monalee_dba <monalee@sungraceinfotech.co.in>)
List pgsql-performance
On 10/11/13 08:32, monalee_dba wrote:
> I would like to know, What is BitMap Heap Scan & BitMap Index Scan? When
> I use EXPLAIN for query, which has LEFT JOIN with 4 different table then
> some time query planner uses Bitmap Heap Scan and some time Bitmap Index
> Scan?

Check out this great presentation:

  http://momjian.us/main/writings/pgsql/optimizer.pdf

The way I understand it is this (Correct me if I am wrong). The bitmap
index scan uses an index to build a bitmap where each bit corresponds to
a data buffer (8k). Since a buffer can contain multiple tuples and not
all of them must match the condition another run over the heap pages is
needed to find the matching tuples. This is the bitmap heap scan. It
iterates over the table data buffers found in the bitmap index scan and
selects only those tuples that match the filter (hence the recheck thing
you see in explain) and visibility conditions.

Torsten


pgsql-performance by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Order By Clause, Slows Query Performance?
Next
From: Marc Mamin
Date:
Subject: CREATE TABLE AS WITH FREEZE ?