pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedBitMap Heap Scan & BitMap Index Scan
3+ messages / 3 participants
[nested] [flat]
* BitMap Heap Scan & BitMap Index Scan
@ 2013-11-10 07:32 monalee_dba <monalee@sungraceinfotech.co.in>
2013-11-13 01:25 ` Re: BitMap Heap Scan & BitMap Index Scan Michael Paquier <michael.paquier@gmail.com>
2013-11-13 09:37 ` Re: BitMap Heap Scan & BitMap Index Scan Torsten Förtsch <torsten.foertsch@gmx.net>
0 siblings, 2 replies; 3+ messages in thread
From: monalee_dba @ 2013-11-10 07:32 UTC (permalink / raw)
To: pgsql-performance
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 thensome time
query planner uses Bitmap Heap Scan and some time Bitmap Index Scan?
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BitMap-Heap-Scan-BitMap-Index-Scan-tp5777632.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BitMap Heap Scan & BitMap Index Scan
2013-11-10 07:32 BitMap Heap Scan & BitMap Index Scan monalee_dba <monalee@sungraceinfotech.co.in>
@ 2013-11-13 01:25 ` Michael Paquier <michael.paquier@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Paquier @ 2013-11-13 01:25 UTC (permalink / raw)
To: monalee_dba <monalee@sungraceinfotech.co.in>; +Cc: 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@sungraceinfotech.co.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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BitMap Heap Scan & BitMap Index Scan
2013-11-10 07:32 BitMap Heap Scan & BitMap Index Scan monalee_dba <monalee@sungraceinfotech.co.in>
@ 2013-11-13 09:37 ` Torsten Förtsch <torsten.foertsch@gmx.net>
1 sibling, 0 replies; 3+ messages in thread
From: Torsten Förtsch @ 2013-11-13 09:37 UTC (permalink / raw)
To: monalee_dba <monalee@sungraceinfotech.co.in>; 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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2013-11-13 09:37 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-11-10 07:32 BitMap Heap Scan & BitMap Index Scan monalee_dba <monalee@sungraceinfotech.co.in>
2013-11-13 01:25 ` Michael Paquier <michael.paquier@gmail.com>
2013-11-13 09:37 ` Torsten Förtsch <torsten.foertsch@gmx.net>
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