Re: BitMap Heap Scan & BitMap Index Scan

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: monalee_dba <monalee(at)sungraceinfotech(dot)co(dot)in>
Cc: PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>
Subject: Re: BitMap Heap Scan & BitMap Index Scan
Date: 2013-11-13 01:25:30
Message-ID: CAB7nPqSp5t+xgALeUkowvOLrFBnvjKD-eEPOD_+2mJOeNsGKpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

http://www.postgresql.org/docs/9.3/static/using-explain.html

On Sun, Nov 10, 2013 at 4:32 PM, monalee_dba
<monalee(at)sungraceinfotech(dot)co(dot)in> 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?
The way to go here would be to have a look at the documentation first:
http://www.postgresql.org/docs/9.3/static/using-explain.html

Then, AFAIK, Bitmap Heap Scan (upper level) is always coupled with
Bitmap Index Scan (lower level) so there are always in at least 2
nodes, at least because you could have multiple Bitmap Index Scan
nodes. The lower node Bitmap Index Scan creates a bitmap of the pages
of the relation to track pages that might contain tuples satisfying
the index condition (1 bit per page, so a relation with 1 million
pages would have roughly 119kB). Then the bitmap is passed to the
upper node called "Bitmap Index Scan", that reads the pages in a more
sequential fashion.

Regards,
--
Michael

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Paquier 2013-11-13 01:31:08 Re: Order By Clause, Slows Query Performance?
Previous Message Jim Nasby 2013-11-13 00:22:36 Re: Horrific time for getting 1 record from an index?