pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Torsten Förtsch <torsten.foertsch@gmx.net>
To: monalee_dba <monalee@sungraceinfotech.co.in>
To: pgsql-performance@postgresql.org
Subject: Re: BitMap Heap Scan & BitMap Index Scan
Date: Wed, 13 Nov 2013 10:37:46 +0100
Message-ID: <5283486A.7000209@gmx.net> (raw)
In-Reply-To: <1384068734255-5777632.post@n5.nabble.com>
References: <1384068734255-5777632.post@n5.nabble.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (3+ messages)

Message-ID: <5283486A.7000209@gmx.net>
Permalink:  ../5283486A.7000209@gmx.net/
Also on:    postgresql.org/message-id/5283486A.7000209@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: torsten.foertsch@gmx.net, monalee@sungraceinfotech.co.in
  Subject: Re: BitMap Heap Scan & BitMap Index Scan
  In-Reply-To: <5283486A.7000209@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox