regression.diffs

text/plain

Filename: regression.diffs
Type: text/plain
Part: 1
Message: Re: POC, WIP: OR-clause support for indexes
diff -U3 /home/alena/postgrespro__copy32/src/test/regress/expected/create_index.out /home/alena/postgrespro__copy32/src/test/regress/results/create_index.out
--- /home/alena/postgrespro__copy32/src/test/regress/expected/create_index.out	2023-11-30 13:50:34.576537110 +0300
+++ /home/alena/postgrespro__copy32/src/test/regress/results/create_index.out	2023-11-30 13:52:10.940412842 +0300
@@ -1838,18 +1838,14 @@
 EXPLAIN (COSTS OFF)
 SELECT * FROM tenk1
   WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
-                                                               QUERY PLAN                                                                
------------------------------------------------------------------------------------------------------------------------------------------
+                   QUERY PLAN                    
+-------------------------------------------------
  Bitmap Heap Scan on tenk1
-   Recheck Cond: (((thousand = 42) AND (tenthous = 1)) OR ((thousand = 42) AND (tenthous = 3)) OR ((thousand = 42) AND (tenthous = 42)))
-   ->  BitmapOr
-         ->  Bitmap Index Scan on tenk1_thous_tenthous
-               Index Cond: ((thousand = 42) AND (tenthous = 1))
-         ->  Bitmap Index Scan on tenk1_thous_tenthous
-               Index Cond: ((thousand = 42) AND (tenthous = 3))
-         ->  Bitmap Index Scan on tenk1_thous_tenthous
-               Index Cond: ((thousand = 42) AND (tenthous = 42))
-(9 rows)
+   Recheck Cond: (thousand = 42)
+   Filter: (tenthous = ANY (ARRAY[1, 3, 42]))
+   ->  Bitmap Index Scan on tenk1_thous_tenthous
+         Index Cond: (thousand = 42)
+(5 rows)
 
 SELECT * FROM tenk1
   WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
@@ -1861,20 +1857,15 @@
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM tenk1
   WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
-                                   QUERY PLAN                                    
----------------------------------------------------------------------------------
+                    QUERY PLAN                    
+--------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on tenk1
-         Recheck Cond: ((hundred = 42) AND ((thousand = 42) OR (thousand = 99)))
-         ->  BitmapAnd
-               ->  Bitmap Index Scan on tenk1_hundred
-                     Index Cond: (hundred = 42)
-               ->  BitmapOr
-                     ->  Bitmap Index Scan on tenk1_thous_tenthous
-                           Index Cond: (thousand = 42)
-                     ->  Bitmap Index Scan on tenk1_thous_tenthous
-                           Index Cond: (thousand = 99)
-(11 rows)
+         Recheck Cond: (hundred = 42)
+         Filter: (thousand = ANY (ARRAY[42, 99]))
+         ->  Bitmap Index Scan on tenk1_hundred
+               Index Cond: (hundred = 42)
+(6 rows)
 
 SELECT count(*) FROM tenk1
   WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
@@ -1887,11 +1878,14 @@
 EXPLAIN (COSTS OFF)
 SELECT * FROM tenk1
   WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
-                               QUERY PLAN                               
-------------------------------------------------------------------------
- Index Scan using tenk1_thous_tenthous on tenk1
-   Index Cond: ((thousand = 42) AND (tenthous = ANY (ARRAY[1, 3, 42])))
-(2 rows)
+                   QUERY PLAN                    
+-------------------------------------------------
+ Bitmap Heap Scan on tenk1
+   Recheck Cond: (thousand = 42)
+   Filter: (tenthous = ANY (ARRAY[1, 3, 42]))
+   ->  Bitmap Index Scan on tenk1_thous_tenthous
+         Index Cond: (thousand = 42)
+(5 rows)
 
 SELECT * FROM tenk1
   WHERE thousand = 42 AND (tenthous = 1 OR tenthous = 3 OR tenthous = 42);
@@ -1903,17 +1897,15 @@
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM tenk1
   WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
-                                 QUERY PLAN                                  
------------------------------------------------------------------------------
+                    QUERY PLAN                    
+--------------------------------------------------
  Aggregate
    ->  Bitmap Heap Scan on tenk1
-         Recheck Cond: ((hundred = 42) AND (thousand = ANY (ARRAY[42, 99])))
-         ->  BitmapAnd
-               ->  Bitmap Index Scan on tenk1_hundred
-                     Index Cond: (hundred = 42)
-               ->  Bitmap Index Scan on tenk1_thous_tenthous
-                     Index Cond: (thousand = ANY (ARRAY[42, 99]))
-(8 rows)
+         Recheck Cond: (hundred = 42)
+         Filter: (thousand = ANY (ARRAY[42, 99]))
+         ->  Bitmap Index Scan on tenk1_hundred
+               Index Cond: (hundred = 42)
+(6 rows)
 
 SELECT count(*) FROM tenk1
   WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
diff -U3 /home/alena/postgrespro__copy32/src/test/regress/expected/join.out /home/alena/postgrespro__copy32/src/test/regress/results/join.out
--- /home/alena/postgrespro__copy32/src/test/regress/expected/join.out	2023-11-30 13:50:34.576537110 +0300
+++ /home/alena/postgrespro__copy32/src/test/regress/results/join.out	2023-11-30 13:52:14.972407590 +0300
@@ -4223,15 +4223,13 @@
                      Index Cond: (hundred = 4)
    ->  Materialize
          ->  Bitmap Heap Scan on tenk1 a
-               Recheck Cond: ((unique1 = 1) OR (unique2 = 3) OR (unique2 = 7))
+               Recheck Cond: ((unique1 = 1) OR (unique2 = ANY (ARRAY[3, 7])))
                ->  BitmapOr
                      ->  Bitmap Index Scan on tenk1_unique1
                            Index Cond: (unique1 = 1)
                      ->  Bitmap Index Scan on tenk1_unique2
-                           Index Cond: (unique2 = 3)
-                     ->  Bitmap Index Scan on tenk1_unique2
-                           Index Cond: (unique2 = 7)
-(19 rows)
+                           Index Cond: (unique2 = ANY (ARRAY[3, 7]))
+(17 rows)
 
 SET enable_or_transformation = on;
 explain (costs off)
@@ -4251,12 +4249,12 @@
                      Index Cond: (hundred = 4)
    ->  Materialize
          ->  Bitmap Heap Scan on tenk1 a
-               Recheck Cond: ((unique2 = ANY (ARRAY[3, 7])) OR (unique1 = 1))
+               Recheck Cond: ((unique1 = 1) OR (unique2 = ANY (ARRAY[3, 7])))
                ->  BitmapOr
-                     ->  Bitmap Index Scan on tenk1_unique2
-                           Index Cond: (unique2 = ANY (ARRAY[3, 7]))
                      ->  Bitmap Index Scan on tenk1_unique1
                            Index Cond: (unique1 = 1)
+                     ->  Bitmap Index Scan on tenk1_unique2
+                           Index Cond: (unique2 = ANY (ARRAY[3, 7]))
 (17 rows)
 
 explain (costs off)
diff -U3 /home/alena/postgrespro__copy32/src/test/regress/expected/sysviews.out /home/alena/postgrespro__copy32/src/test/regress/results/sysviews.out
--- /home/alena/postgrespro__copy32/src/test/regress/expected/sysviews.out	2023-11-30 13:50:34.584537100 +0300
+++ /home/alena/postgrespro__copy32/src/test/regress/results/sysviews.out	2023-11-30 13:52:24.524395130 +0300
@@ -123,7 +123,7 @@
  enable_memoize                 | on
  enable_mergejoin               | on
  enable_nestloop                | on
- enable_or_transformation       | off
+ enable_or_transformation       | on
  enable_parallel_append         | on
  enable_parallel_hash           | on
  enable_partition_pruning       | on
diff -U3 /home/alena/postgrespro__copy32/src/test/regress/expected/tidscan.out /home/alena/postgrespro__copy32/src/test/regress/results/tidscan.out
--- /home/alena/postgrespro__copy32/src/test/regress/expected/tidscan.out	2023-11-30 13:50:34.584537100 +0300
+++ /home/alena/postgrespro__copy32/src/test/regress/results/tidscan.out	2023-11-30 13:52:24.328395386 +0300
@@ -62,7 +62,7 @@
                           QUERY PLAN                          
 --------------------------------------------------------------
  Tid Scan on tidscan
-   TID Cond: (ctid = ANY (ARRAY['(0,2)'::tid, '(0,1)'::tid]))
+   TID Cond: ((ctid = '(0,2)'::tid) OR ('(0,1)'::tid = ctid))
 (2 rows)
 
 SELECT ctid, * FROM tidscan WHERE ctid = '(0,2)' OR '(0,1)' = ctid;