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)
-- 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
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?
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
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?
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)
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?
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?
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?
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?
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?
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?
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?
-- 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
-- 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
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
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
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
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?
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?
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?
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)
-- 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;
-- 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;
-- 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;