Accept plan changes in btree_gist contrib module
authorTomas Vondra <[email protected]>
Wed, 30 Aug 2017 22:45:10 +0000 (00:45 +0200)
committerTomas Vondra <[email protected]>
Wed, 30 Aug 2017 22:45:10 +0000 (00:45 +0200)
The changes are fairly simple and generally expected due to distributing
upstream queries, so adding either Remote Fast Query Execution or Remote
Subquery Scan nodes.

An explicit ORDER BY was added to a few queries to stabilize the output.

24 files changed:
contrib/btree_gist/expected/bit.out
contrib/btree_gist/expected/bytea.out
contrib/btree_gist/expected/cash.out
contrib/btree_gist/expected/char.out
contrib/btree_gist/expected/date.out
contrib/btree_gist/expected/enum.out
contrib/btree_gist/expected/float4.out
contrib/btree_gist/expected/float8.out
contrib/btree_gist/expected/int2.out
contrib/btree_gist/expected/int4.out
contrib/btree_gist/expected/int8.out
contrib/btree_gist/expected/interval.out
contrib/btree_gist/expected/macaddr.out
contrib/btree_gist/expected/macaddr8.out
contrib/btree_gist/expected/not_equal.out
contrib/btree_gist/expected/numeric.out
contrib/btree_gist/expected/text.out
contrib/btree_gist/expected/time.out
contrib/btree_gist/expected/timestamp.out
contrib/btree_gist/expected/timestamptz.out
contrib/btree_gist/expected/varbit.out
contrib/btree_gist/sql/bytea.sql
contrib/btree_gist/sql/macaddr.sql
contrib/btree_gist/sql/macaddr8.sql

index 8606baf366ed73ba3b9f31debe8fe618ab2bcce9..ebdf4a8c44b75d56502113b69b731a5c1c6443c2 100644 (file)
@@ -68,9 +68,11 @@ SELECT count(*) FROM bittmp WHERE a >   '011011000100010111011000110000100';
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
 SELECT a FROM bittmp WHERE a BETWEEN '1000000' and '1000001';
-                              QUERY PLAN                               
------------------------------------------------------------------------
- Index Only Scan using bitidx on bittmp
-   Index Cond: ((a >= B'1000000'::"bit") AND (a <= B'1000001'::"bit"))
-(2 rows)
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Remote Fast Query Execution
+   Node/s: datanode_1, datanode_2
+   ->  Index Only Scan using bitidx on bittmp
+         Index Cond: ((a >= B'1000000'::"bit") AND (a <= B'1000001'::"bit"))
+(4 rows)
 
index b9efa73c0855f87d79e8598b56385a02b7d5b46a..6059f9e3a280e717fdd29679b281a6bd1aec3daf 100644 (file)
@@ -74,14 +74,17 @@ SELECT count(*) FROM byteatmp WHERE a  =  '2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbed
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT a FROM byteatmp where a > 'ffa'::bytea;
-                 QUERY PLAN                 
---------------------------------------------
- Index Only Scan using byteaidx on byteatmp
-   Index Cond: (a > '\x666661'::bytea)
-(2 rows)
+SELECT a FROM byteatmp where a > 'ffa'::bytea ORDER BY a;
+                       QUERY PLAN                       
+--------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+   ->  Sort
+         Sort Key: a
+         ->  Index Only Scan using byteaidx on byteatmp
+               Index Cond: (a > '\x666661'::bytea)
+(5 rows)
 
-SELECT a FROM byteatmp where a > 'ffa'::bytea;
+SELECT a FROM byteatmp where a > 'ffa'::bytea ORDER BY a;
                a                
 --------------------------------
  \x666662656532373363376262
index cacbd718541fd98769c5154491dc71f4099ce974..81bc43f2908213dff6303940d1e6bd55669aa19a 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM moneytmp WHERE a >  '22649.64'::money;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
-                    QUERY PLAN                    
---------------------------------------------------
+                          QUERY PLAN                          
+--------------------------------------------------------------
  Limit
-   ->  Index Only Scan using moneyidx on moneytmp
-         Order By: (a <-> '$21,472.79'::money)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using moneyidx on moneytmp
+                     Order By: (a <-> '$21,472.79'::money)
+(5 rows)
 
 SELECT a, a <-> '21472.79' FROM moneytmp ORDER BY a <-> '21472.79' LIMIT 3;
      a      | ?column? 
index d715c045cc152a4ca3cb53d4514535a832ac8f86..dca0a8d7f5c031741f034eebe4c22aefaab2d3ca 100644 (file)
@@ -68,11 +68,13 @@ SELECT count(*) FROM chartmp WHERE a >   '31b0'::char(32);
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
 SELECT * FROM chartmp WHERE a BETWEEN '31a' AND '31c';
-                          QUERY PLAN                           
----------------------------------------------------------------
- Index Only Scan using charidx on chartmp
-   Index Cond: ((a >= '31a'::bpchar) AND (a <= '31c'::bpchar))
-(2 rows)
+                             QUERY PLAN                              
+---------------------------------------------------------------------
+ Remote Fast Query Execution
+   Node/s: datanode_1, datanode_2
+   ->  Index Only Scan using charidx on chartmp
+         Index Cond: ((a >= '31a'::bpchar) AND (a <= '31c'::bpchar))
+(4 rows)
 
 SELECT * FROM chartmp WHERE a BETWEEN '31a' AND '31c';
   a   
index 5db864bb82caaf0078e8ce6727eb04283fc82a10..4fd08e1998f945b766ec6b16916dd76d6b5b0496 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM datetmp WHERE a >  '2001-02-13'::date;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '2001-02-13' FROM datetmp ORDER BY a <-> '2001-02-13' LIMIT 3;
-                   QUERY PLAN                   
-------------------------------------------------
+                         QUERY PLAN                         
+------------------------------------------------------------
  Limit
-   ->  Index Only Scan using dateidx on datetmp
-         Order By: (a <-> '02-13-2001'::date)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using dateidx on datetmp
+                     Order By: (a <-> '02-13-2001'::date)
+(5 rows)
 
 SELECT a, a <-> '2001-02-13' FROM datetmp ORDER BY a <-> '2001-02-13' LIMIT 3;
      a      | ?column? 
index c4b769dd4b77cc064919cbd750ce3db905ea7823..156b245c5cda6eb475bfbb7337ba7cd77c913161 100644 (file)
@@ -80,12 +80,14 @@ SELECT count(*) FROM enumtmp WHERE a >  'g'::rainbow;
 
 EXPLAIN (COSTS OFF)
 SELECT count(*) FROM enumtmp WHERE a >= 'g'::rainbow;
-                  QUERY PLAN                   
------------------------------------------------
- Aggregate
-   ->  Bitmap Heap Scan on enumtmp
-         Recheck Cond: (a >= 'g'::rainbow)
-         ->  Bitmap Index Scan on enumidx
-               Index Cond: (a >= 'g'::rainbow)
-(5 rows)
+                        QUERY PLAN                         
+-----------------------------------------------------------
+ Finalize Aggregate
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Partial Aggregate
+               ->  Bitmap Heap Scan on enumtmp
+                     Recheck Cond: (a >= 'g'::rainbow)
+                     ->  Bitmap Index Scan on enumidx
+                           Index Cond: (a >= 'g'::rainbow)
+(7 rows)
 
index abbd9eef4e8aa4c1a4ea905197f2cc379d05ec36..551763a9da2b98bf307eacc270d747bf7b2a5d1f 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM float4tmp WHERE a >  -179.0::float4;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;
-                     QUERY PLAN                     
-----------------------------------------------------
+                           QUERY PLAN                           
+----------------------------------------------------------------
  Limit
-   ->  Index Only Scan using float4idx on float4tmp
-         Order By: (a <-> '-179'::real)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using float4idx on float4tmp
+                     Order By: (a <-> '-179'::real)
+(5 rows)
 
 SELECT a, a <-> '-179.0' FROM float4tmp ORDER BY a <-> '-179.0' LIMIT 3;
     a     | ?column? 
index 5111dbdfaea033cd845e563a526df67ac713c940..d8f2d9a9e4155b1000eb1bf3c77bcf902b227d87 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM float8tmp WHERE a >  -1890.0::float8;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '-1890.0' FROM float8tmp ORDER BY a <-> '-1890.0' LIMIT 3;
-                     QUERY PLAN                      
------------------------------------------------------
+                           QUERY PLAN                            
+-----------------------------------------------------------------
  Limit
-   ->  Index Only Scan using float8idx on float8tmp
-         Order By: (a <-> '-1890'::double precision)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using float8idx on float8tmp
+                     Order By: (a <-> '-1890'::double precision)
+(5 rows)
 
 SELECT a, a <-> '-1890.0' FROM float8tmp ORDER BY a <-> '-1890.0' LIMIT 3;
       a       |  ?column?  
index 50a332939bd484c92b92cf8bf0cc117bb1308f73..abc87b801eda1193cc277b5208656272c474e602 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM int2tmp WHERE a >  237::int2;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '237' FROM int2tmp ORDER BY a <-> '237' LIMIT 3;
-                   QUERY PLAN                   
-------------------------------------------------
+                         QUERY PLAN                         
+------------------------------------------------------------
  Limit
-   ->  Index Only Scan using int2idx on int2tmp
-         Order By: (a <-> '237'::smallint)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using int2idx on int2tmp
+                     Order By: (a <-> '237'::smallint)
+(5 rows)
 
 SELECT a, a <-> '237' FROM int2tmp ORDER BY a <-> '237' LIMIT 3;
   a  | ?column? 
index 6bbdc7c3f4bf98b61923dae8237cc816b615b58b..5e825eee23c7ffd070116bfdbc10cac6f98c3828 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM int4tmp WHERE a >  237::int4;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '237' FROM int4tmp ORDER BY a <-> '237' LIMIT 3;
-                   QUERY PLAN                   
-------------------------------------------------
+                         QUERY PLAN                         
+------------------------------------------------------------
  Limit
-   ->  Index Only Scan using int4idx on int4tmp
-         Order By: (a <-> 237)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using int4idx on int4tmp
+                     Order By: (a <-> 237)
+(5 rows)
 
 SELECT a, a <-> '237' FROM int4tmp ORDER BY a <-> '237' LIMIT 3;
   a  | ?column? 
index eff77c26b5adb6e1ddd6c40afb64d74f74262e83..131412a47200e897fdd74980574895f9d64e1bbc 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM int8tmp WHERE a >  464571291354841::int8;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> '464571291354841' LIMIT 3;
-                     QUERY PLAN                      
------------------------------------------------------
+                           QUERY PLAN                            
+-----------------------------------------------------------------
  Limit
-   ->  Index Only Scan using int8idx on int8tmp
-         Order By: (a <-> '464571291354841'::bigint)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using int8idx on int8tmp
+                     Order By: (a <-> '464571291354841'::bigint)
+(5 rows)
 
 SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> '464571291354841' LIMIT 3;
         a        |    ?column?    
index 4c3d494e4a656ed4830bb47b0d3b1256b1a308a9..f00584f80e27ec5abee865d9a6e82799570802c3 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM intervaltmp WHERE a >  '199 days 21:21:23'::interval;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 21:21:23' LIMIT 3;
-                                QUERY PLAN                                 
----------------------------------------------------------------------------
+                                      QUERY PLAN                                       
+---------------------------------------------------------------------------------------
  Limit
-   ->  Index Only Scan using intervalidx on intervaltmp
-         Order By: (a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using intervalidx on intervaltmp
+                     Order By: (a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval)
+(5 rows)
 
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 21:21:23' LIMIT 3;
                   a                  |               ?column?               
@@ -92,12 +94,14 @@ SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 21
 SET enable_indexonlyscan=off;
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 21:21:23' LIMIT 3;
-                                QUERY PLAN                                 
----------------------------------------------------------------------------
+                                      QUERY PLAN                                       
+---------------------------------------------------------------------------------------
  Limit
-   ->  Index Scan using intervalidx on intervaltmp
-         Order By: (a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Scan using intervalidx on intervaltmp
+                     Order By: (a <-> '@ 199 days 21 hours 21 mins 23 secs'::interval)
+(5 rows)
 
 SELECT a, a <-> '199 days 21:21:23' FROM intervaltmp ORDER BY a <-> '199 days 21:21:23' LIMIT 3;
                   a                  |               ?column?               
index c0a4c6287f3210e6f002be80efb61f4f68b87128..bc4eee0552a2c46332524af1d832dac1637d449e 100644 (file)
@@ -67,14 +67,17 @@ SELECT count(*) FROM macaddrtmp WHERE a >  '22:00:5c:e5:9b:0d'::macaddr;
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr;
-                    QUERY PLAN                    
---------------------------------------------------
- Index Only Scan using macaddridx on macaddrtmp
-   Index Cond: (a < '02:03:04:05:06:07'::macaddr)
-(2 rows)
+SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr ORDER BY a;
+                          QUERY PLAN                          
+--------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+   ->  Sort
+         Sort Key: a
+         ->  Index Only Scan using macaddridx on macaddrtmp
+               Index Cond: (a < '02:03:04:05:06:07'::macaddr)
+(5 rows)
 
-SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr;
+SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr ORDER BY a;
          a         
 -------------------
  01:02:37:05:4f:36
index e5ec6a5deab1beaf4d5076b79f05a10cfa3629dd..1d87771cde7f82b0bb30064a78aa62fb22fae302 100644 (file)
@@ -67,14 +67,17 @@ SELECT count(*) FROM macaddr8tmp WHERE a >  '22:00:5c:e5:9b:0d'::macaddr8;
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8;
-                       QUERY PLAN                        
----------------------------------------------------------
- Index Only Scan using macaddr8idx on macaddr8tmp
-   Index Cond: (a < '02:03:04:ff:fe:05:06:07'::macaddr8)
-(2 rows)
+SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8 ORDER BY a;
+                             QUERY PLAN                              
+---------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+   ->  Sort
+         Sort Key: a
+         ->  Index Only Scan using macaddr8idx on macaddr8tmp
+               Index Cond: (a < '02:03:04:ff:fe:05:06:07'::macaddr8)
+(5 rows)
 
-SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8;
+SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8 ORDER BY a;
             a            
 -------------------------
  01:02:37:ff:fe:05:4f:36
index 85b1e868a87ca6c5dbb12706e7dfc8ed51c3b525..e07ce5262872230b2d76c01403c531be014e60dd 100644 (file)
@@ -11,13 +11,15 @@ INSERT INTO test_ne VALUES('2011-09-01', 43.7);
 INSERT INTO test_ne SELECT '2009-01-01', 10.7 FROM generate_series(1,1000);
 SET enable_indexscan to false;
 EXPLAIN (COSTS OFF) SELECT * FROM test_ne WHERE a <> '2009-01-01' AND b <> 10.7;
-                                              QUERY PLAN                                              
-------------------------------------------------------------------------------------------------------
- Bitmap Heap Scan on test_ne
-   Recheck Cond: ((a <> 'Thu Jan 01 00:00:00 2009'::timestamp without time zone) AND (b <> 10.7))
-   ->  Bitmap Index Scan on test_ne_idx
-         Index Cond: ((a <> 'Thu Jan 01 00:00:00 2009'::timestamp without time zone) AND (b <> 10.7))
-(4 rows)
+                                                 QUERY PLAN                                                 
+------------------------------------------------------------------------------------------------------------
+ Remote Fast Query Execution
+   Node/s: datanode_1, datanode_2
+   ->  Bitmap Heap Scan on test_ne
+         Recheck Cond: ((a <> 'Thu Jan 01 00:00:00 2009'::timestamp without time zone) AND (b <> 10.7))
+         ->  Bitmap Index Scan on test_ne_idx
+               Index Cond: ((a <> 'Thu Jan 01 00:00:00 2009'::timestamp without time zone) AND (b <> 10.7))
+(6 rows)
 
 SELECT * FROM test_ne WHERE a <> '2009-01-01' AND b <> 10.7;
             a             |   b   
index ae839b8ec839d2598b1dd03262365ea14861c405..c29432fcf21cc9ded08937ed3390d9fd8a931125 100644 (file)
@@ -190,13 +190,14 @@ SELECT count(*) FROM numerictmp WHERE a >  0 ;
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
 SELECT * FROM numerictmp WHERE a BETWEEN 1 AND 300 ORDER BY a;
-                             QUERY PLAN                              
----------------------------------------------------------------------
- Sort
-   Sort Key: a
-   ->  Index Only Scan using numericidx on numerictmp
-         Index Cond: ((a >= '1'::numeric) AND (a <= '300'::numeric))
-(4 rows)
+                                QUERY PLAN                                 
+---------------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+   ->  Sort
+         Sort Key: a
+         ->  Index Only Scan using numericidx on numerictmp
+               Index Cond: ((a >= '1'::numeric) AND (a <= '300'::numeric))
+(5 rows)
 
 SELECT * FROM numerictmp WHERE a BETWEEN 1 AND 300 ORDER BY a;
      a      
index bb4e2e62d1d532d84e85a5043af7fde4f1dc267c..40ee34f5c984ae440d50009fcbade192fa265c23 100644 (file)
@@ -75,11 +75,13 @@ SELECT count(*) FROM texttmp WHERE a  =  '2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbedb
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
 SELECT * FROM texttmp WHERE a BETWEEN '31a' AND '31c';
-                        QUERY PLAN                         
------------------------------------------------------------
- Index Only Scan using textidx on texttmp
-   Index Cond: ((a >= '31a'::text) AND (a <= '31c'::text))
-(2 rows)
+                           QUERY PLAN                            
+-----------------------------------------------------------------
+ Remote Fast Query Execution
+   Node/s: datanode_1, datanode_2
+   ->  Index Only Scan using textidx on texttmp
+         Index Cond: ((a >= '31a'::text) AND (a <= '31c'::text))
+(4 rows)
 
 SELECT * FROM texttmp WHERE a BETWEEN '31a' AND '31c';
   a   
index ec95ef77c57a668c0f3f8e96393281c5d0f14bcf..c5ad6f414092d78f9afe36c488c4d09b3e6bfed4 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM timetmp WHERE a >  '10:57:11'::time;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
-                          QUERY PLAN                          
---------------------------------------------------------------
+                                QUERY PLAN                                
+--------------------------------------------------------------------------
  Limit
-   ->  Index Only Scan using timeidx on timetmp
-         Order By: (a <-> '10:57:11'::time without time zone)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using timeidx on timetmp
+                     Order By: (a <-> '10:57:11'::time without time zone)
+(5 rows)
 
 SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
     a     |    ?column?     
index 0d94f2f245ceab9e99d84d39f95d476eba114f5d..ed4533614485530a3fec2e7a15cd4abbd1c16271 100644 (file)
@@ -74,12 +74,14 @@ SELECT count(*) FROM timestamptmp WHERE a >  '2004-10-26 08:55:08'::timestamp;
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> '2004-10-26 08:55:08' LIMIT 3;
-                                    QUERY PLAN                                     
------------------------------------------------------------------------------------
+                                          QUERY PLAN                                           
+-----------------------------------------------------------------------------------------------
  Limit
-   ->  Index Only Scan using timestampidx on timestamptmp
-         Order By: (a <-> 'Tue Oct 26 08:55:08 2004'::timestamp without time zone)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using timestampidx on timestamptmp
+                     Order By: (a <-> 'Tue Oct 26 08:55:08 2004'::timestamp without time zone)
+(5 rows)
 
 SELECT a, a <-> '2004-10-26 08:55:08' FROM timestamptmp ORDER BY a <-> '2004-10-26 08:55:08' LIMIT 3;
             a             |              ?column?              
index 75a15a425684fa1f4ffe78696c1d58105fa2e054..04e6850093c0eb571226cfbd92a09f4fb3d4505b 100644 (file)
@@ -194,12 +194,14 @@ SELECT count(*) FROM timestamptztmp WHERE a >  '2018-12-18 10:59:54 GMT+4'::time
 
 EXPLAIN (COSTS OFF)
 SELECT a, a <-> '2018-12-18 10:59:54 GMT+2' FROM timestamptztmp ORDER BY a <-> '2018-12-18 10:59:54 GMT+2' LIMIT 3;
-                                     QUERY PLAN                                     
-------------------------------------------------------------------------------------
+                                           QUERY PLAN                                           
+------------------------------------------------------------------------------------------------
  Limit
-   ->  Index Only Scan using timestamptzidx on timestamptztmp
-         Order By: (a <-> 'Tue Dec 18 04:59:54 2018 PST'::timestamp with time zone)
-(3 rows)
+   ->  Remote Subquery Scan on all (datanode_1,datanode_2)
+         ->  Limit
+               ->  Index Only Scan using timestamptzidx on timestamptztmp
+                     Order By: (a <-> 'Tue Dec 18 04:59:54 2018 PST'::timestamp with time zone)
+(5 rows)
 
 SELECT a, a <-> '2018-12-18 10:59:54 GMT+2' FROM timestamptztmp ORDER BY a <-> '2018-12-18 10:59:54 GMT+2' LIMIT 3;
               a               |             ?column?              
index 538ace85c90edd02224b4b071ccdea46ece7c18f..c871db4c95109f203627fa2ae0fedae91b3d1d22 100644 (file)
@@ -68,9 +68,11 @@ SELECT count(*) FROM varbittmp WHERE a >   '1110100111010'::varbit;
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
 SELECT a FROM bittmp WHERE a BETWEEN '1000000' and '1000001';
-                              QUERY PLAN                               
------------------------------------------------------------------------
- Index Only Scan using bitidx on bittmp
-   Index Cond: ((a >= B'1000000'::"bit") AND (a <= B'1000001'::"bit"))
-(2 rows)
+                                 QUERY PLAN                                  
+-----------------------------------------------------------------------------
+ Remote Fast Query Execution
+   Node/s: datanode_1, datanode_2
+   ->  Index Only Scan using bitidx on bittmp
+         Index Cond: ((a >= B'1000000'::"bit") AND (a <= B'1000001'::"bit"))
+(4 rows)
 
index 6885f5e56d5c84c8b6a231b714570dc309130477..630b3b9492ffc05b8f473805bdd1d9d04c1795f9 100644 (file)
@@ -36,5 +36,5 @@ SELECT count(*) FROM byteatmp WHERE a  =  '2eb2c961c1cbf6 cf8d7b68cb9a2f36 7bbed
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT a FROM byteatmp where a > 'ffa'::bytea;
-SELECT a FROM byteatmp where a > 'ffa'::bytea;
+SELECT a FROM byteatmp where a > 'ffa'::bytea ORDER BY a;
+SELECT a FROM byteatmp where a > 'ffa'::bytea ORDER BY a;
index 85c271f7ce3c6744e55500013542d14945f414b5..d3fdd02cfda37a2a540bdf3f617929fa59d44cea 100644 (file)
@@ -33,5 +33,5 @@ SELECT count(*) FROM macaddrtmp WHERE a >  '22:00:5c:e5:9b:0d'::macaddr;
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr;
-SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr;
+SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr ORDER BY a;
+SELECT * FROM macaddrtmp WHERE a < '02:03:04:05:06:07'::macaddr ORDER BY a;
index 61e7d7af405d19078d734cba7ac3b310ed7b2925..76252374eb7e1263ac13a03ea34aaa8a09f482b9 100644 (file)
@@ -33,5 +33,5 @@ SELECT count(*) FROM macaddr8tmp WHERE a >  '22:00:5c:e5:9b:0d'::macaddr8;
 -- Test index-only scans
 SET enable_bitmapscan=off;
 EXPLAIN (COSTS OFF)
-SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8;
-SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8;
+SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8 ORDER BY a;
+SELECT * FROM macaddr8tmp WHERE a < '02:03:04:05:06:07'::macaddr8 ORDER BY a;