Re: BitMap Heap Scan & BitMap Index Scan

From: Torsten Förtsch <torsten(dot)foertsch(at)gmx(dot)net>
To: monalee_dba <monalee(at)sungraceinfotech(dot)co(dot)in>, pgsql-performance(at)postgresql(dot)org
Subject: Re: BitMap Heap Scan & BitMap Index Scan
Date: 2013-11-13 09:37:46
Message-ID: 5283486A.7000209@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Marc Mamin 2013-11-13 10:29:14 CREATE TABLE AS WITH FREEZE ?
Previous Message Albe Laurenz 2013-11-13 09:07:11 Re: Order By Clause, Slows Query Performance?