regression.diffs

application/octet-stream

Filename: regression.diffs
Type: application/octet-stream
Part: 1
Message: Re: Relaxing constraints on BitmapAnd eligibility?
diff -U3 /home/adept/devel/postgres/postgres/src/test/regress/expected/join.out /home/adept/devel/postgres/postgres/src/test/regress/results/join.out
--- /home/adept/devel/postgres/postgres/src/test/regress/expected/join.out	2025-02-26 19:22:27.164859996 +0000
+++ /home/adept/devel/postgres/postgres/src/test/regress/results/join.out	2025-02-26 20:38:15.870734548 +0000
@@ -4424,23 +4424,33 @@
 select * from tenk1 a join tenk1 b on
   (a.unique1 < 20 or a.unique1 = 3 or a.unique1 = 1 and b.unique1 = 2) or
   ((a.unique2 = 3 or a.unique2 = 7) and b.hundred = 4);
-                                                                         QUERY PLAN                                                                          
--------------------------------------------------------------------------------------------------------------------------------------------------------------
+                                                                                                    QUERY PLAN                                                                                                     
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Nested Loop
    Join Filter: ((a.unique1 < 20) OR (a.unique1 = 3) OR ((a.unique1 = 1) AND (b.unique1 = 2)) OR (((a.unique2 = 3) OR (a.unique2 = 7)) AND (b.hundred = 4)))
    ->  Seq Scan on tenk1 b
    ->  Materialize
          ->  Bitmap Heap Scan on tenk1 a
-               Recheck Cond: (((unique2 = 3) OR (unique2 = 7)) OR ((unique1 = 3) OR (unique1 = 1)) OR (unique1 < 20))
+               Recheck Cond: ((((unique2 = 3) OR (unique2 = 7)) OR ((unique1 = 3) OR (unique1 = 1)) OR (unique1 < 20)) AND ((unique1 = 1) OR ((unique2 = 3) OR (unique2 = 7)) OR (unique1 = 3) OR (unique1 < 20)))
                Filter: ((unique1 < 20) OR (unique1 = 3) OR (unique1 = 1) OR (unique2 = 3) OR (unique2 = 7))
-               ->  BitmapOr
-                     ->  Bitmap Index Scan on tenk1_unique2
-                           Index Cond: (unique2 = ANY ('{3,7}'::integer[]))
-                     ->  Bitmap Index Scan on tenk1_unique1
-                           Index Cond: (unique1 = ANY ('{3,1}'::integer[]))
-                     ->  Bitmap Index Scan on tenk1_unique1
-                           Index Cond: (unique1 < 20)
-(14 rows)
+               ->  BitmapAnd
+                     ->  BitmapOr
+                           ->  Bitmap Index Scan on tenk1_unique2
+                                 Index Cond: (unique2 = ANY ('{3,7}'::integer[]))
+                           ->  Bitmap Index Scan on tenk1_unique1
+                                 Index Cond: (unique1 = ANY ('{3,1}'::integer[]))
+                           ->  Bitmap Index Scan on tenk1_unique1
+                                 Index Cond: (unique1 < 20)
+                     ->  BitmapOr
+                           ->  Bitmap Index Scan on tenk1_unique1
+                                 Index Cond: (unique1 = 1)
+                           ->  Bitmap Index Scan on tenk1_unique2
+                                 Index Cond: (unique2 = ANY ('{3,7}'::integer[]))
+                           ->  Bitmap Index Scan on tenk1_unique1
+                                 Index Cond: (unique1 = 3)
+                           ->  Bitmap Index Scan on tenk1_unique1
+                                 Index Cond: (unique1 < 20)
+(24 rows)
 
 --
 -- test placement of movable quals in a parameterized join tree