On Tue, Mar 21, 2017 at 4:47 PM, Thomas Munro
<thomas.mu...@enterprisedb.com> wrote:
> 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.

Thanks for reporting.  Seems like we are getting issues related to

I think in this area we need more testing, reason these are not tested
properly because these are not the natural case for parallel bitmap.
I think in next few days I will test more such cases by forcing the
parallel bitmap.

Here is the patch to fix the issue in hand.  I have also run the
regress suit with force_parallel_mode=regress and all the test are

Results after fix.

postgres=# explain analyze SELECT * FROM inet_tbl WHERE i <>
                                                            QUERY PLAN
 Gather Merge  (cost=16.53..16.62 rows=9 width=64) (actual
time=4.467..4.478 rows=16 loops=1)
   Workers Planned: 1
   Workers Launched: 1
   ->  Sort  (cost=16.52..16.54 rows=9 width=64) (actual
time=0.090..0.093 rows=8 loops=2)
         Sort Key: i
         Sort Method: quicksort  Memory: 25kB
         ->  Parallel Bitmap Heap Scan on inet_tbl  (cost=12.26..16.37
rows=9 width=64) (actual time=0.048..0.050 rows=8 loops=2)
               Recheck Cond: (i <> ''::inet)
               Heap Blocks: exact=1
               ->  Bitmap Index Scan on inet_idx3  (cost=0.00..12.25
rows=16 width=0) (actual time=0.016..0.016 rows=16 loops=1)
                     Index Cond: (i <> ''::inet)
 Planning time: 0.149 ms
 Execution time: 5.143 ms
(13 rows)

postgres=# SELECT * FROM inet_tbl WHERE i <> ''::cidr
         c          |        i
--------------------+------------------         |         |        |         |        |        |        |         |     |     |     |     |     |
 ::ffff: | ::
 10:23::f1/128      | 10:23::f1/64
 10:23::8000/113    | 10:23::ffff
(16 rows)

Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment: fix_parallel_bitmap_handling_onepage.patch
Description: Binary data

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to