Re: EXPLAIN ANALYZE of BRIN bitmap index scan with disjunction

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Chris Wilson <chris(dot)wilson(at)cantabcapital(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: EXPLAIN ANALYZE of BRIN bitmap index scan with disjunction
Date: 2019-06-20 18:09:13
Message-ID: CAHOFxGpB_5dLgXe0+1ZQrn1TaO+BpCC3HFh4not5UVY4Dowccg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

For kicks I tried the example given and got the below which seems more
expected.

explain analyze select * from brin_test where id >= 90000;

Bitmap Heap Scan on brin_test (cost=5.78..627.36 rows=9861 width=8)
(actual time=0.373..7.309 rows=10001 loops=1)
Recheck Cond: (id >= 90000)
Rows Removed by Index Recheck: 3215
Heap Blocks: lossy=59
-> Bitmap Index Scan on idx_brin_test_brin (cost=0.00..3.32 rows=14286
width=0) (actual time=0.018..0.019 rows=640 loops=1)
Index Cond: (id >= 90000)
Planning Time: 0.101 ms
Execution Time: *13.485 ms*

explain analyze select * from brin_test where id >= 90000 and r in (1,3);

Bitmap Heap Scan on brin_test (cost=3.36..553.50 rows=197 width=8) (actual
time=0.390..1.829 rows=200 loops=1)
Recheck Cond: ((id >= 90000) AND (r = ANY ('{1,3}'::integer[])))
Rows Removed by Index Recheck: 13016
Heap Blocks: lossy=59
-> Bitmap Index Scan on idx_brin_test_brin (cost=0.00..3.31 rows=7143
width=0) (actual time=0.026..0.027 rows=1280 loops=1)
Index Cond: ((id >= 90000) AND (r = ANY ('{1,3}'::integer[])))
Planning Time: 0.089 ms
Execution Time: *1.978 ms*

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2019-06-20 18:13:35 Re: EXPLAIN ANALYZE of BRIN bitmap index scan with disjunction
Previous Message Simon Riggs 2019-06-20 16:51:26 Re: EXPLAIN ANALYZE of BRIN bitmap index scan with disjunction