[HACKERS] Problem in Parallel Bitmap Heap Scan? - Mailing list pgsql-hackers

From Thomas Munro
Subject [HACKERS] Problem in Parallel Bitmap Heap Scan?
Date
Msg-id CAEepm=19Cmnfbi-j2Bw-a6yGPeHE1OVhKvvKz9bRBTJGKfGHMA@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] Problem in Parallel Bitmap Heap Scan?  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
Hi,

I noticed a failure in the inet.sql test while running the regression
tests with parallelism cranked up, and can reproduce it interactively
as follows.  After an spgist index is created and the plan changes to
the one shown below, the query returns no rows.

regression=# set force_parallel_mode = regress;
SET
regression=# set max_parallel_workers_per_gather = 2;
SET
regression=# set parallel_tuple_cost = 0;
SET
regression=# set parallel_setup_cost = 0;
SET
regression=# set min_parallel_table_scan_size = 0;
SET
regression=# set min_parallel_index_scan_size = 0;
SET
regression=# set enable_seqscan = off;
SET
regression=# SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr
ORDER BY i;

c          |        i
--------------------+------------------10.0.0.0/8         | 9.1.2.3/810.0.0.0/8         | 10.1.2.3/810.0.0.0/32
|10.1.2.3/810.0.0.0/8         | 10.1.2.3/810.1.0.0/16        | 10.1.2.3/1610.1.2.0/24        | 10.1.2.3/2410.1.2.3/32
    | 10.1.2.310.0.0.0/8         | 11.1.2.3/8192.168.1.0/24     | 192.168.1.226/24192.168.1.0/24     |
192.168.1.255/24192.168.1.0/24    | 192.168.1.0/25192.168.1.0/24     | 192.168.1.255/25192.168.1.0/26     |
192.168.1.22610.0.0.0/8        | 10::/8::ffff:1.2.3.4/128 | ::4.3.2.1/2410:23::f1/128      |
10:23::f1/6410:23::8000/113   | 10:23::ffff
 
(17 rows)

regression=# CREATE INDEX inet_idx3 ON inet_tbl using spgist (i);
CREATE INDEX
regression=# SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr
ORDER BY i;c | i
---+---
(0 rows)

regression=# explain SELECT * FROM inet_tbl WHERE i <>
'192.168.1.0/24'::cidr ORDER BY i;                                      QUERY PLAN
-----------------------------------------------------------------------------------------Gather Merge
(cost=16.57..16.67rows=10 width=64)  Workers Planned: 1  ->  Sort  (cost=16.56..16.58 rows=10 width=64)        Sort
Key:i        ->  Parallel Bitmap Heap Scan on inet_tbl  (cost=12.26..16.39
 
rows=10 width=64)              Recheck Cond: (i <> '192.168.1.0/24'::inet)              ->  Bitmap Index Scan on
inet_idx3 (cost=0.00..12.26
 
rows=17 width=0)                    Index Cond: (i <> '192.168.1.0/24'::inet)
(8 rows)


-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: [HACKERS] segfault in hot standby for hash indexes
Next
From: Etsuro Fujita
Date:
Subject: [HACKERS] postgres_fdw: correct regression test for parameterized scan forforeign table