diff --git a/src/test/regress/expected/bypass_simplequery_support.out b/src/test/regress/expected/bypass_simplequery_support.out index 7527bc401..c174ae5b6 100755 --- a/src/test/regress/expected/bypass_simplequery_support.out +++ b/src/test/regress/expected/bypass_simplequery_support.out @@ -14,121 +14,121 @@ NOTICE: table "test_bypass_sq1" does not exist, skipping create table test_bypass_sq1(col1 int, col2 int, col3 text); create index itest_bypass_sq1 on test_bypass_sq1(col1,col2); -- bypass insert data - explain insert into test_bypass_sq1 values (0,0,'test_insert'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (0,0,'test_insert'); - explain insert into test_bypass_sq1 values (0,1,'test_insert'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (0,1,'test_insert'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (0,1,'test_insert'); - explain insert into test_bypass_sq1 values (1,1,'test_insert'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (1,1,'test_insert'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (1,1,'test_insert'); - explain insert into test_bypass_sq1 values (1,2,'test_insert'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (1,2,'test_insert'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (1,2,'test_insert'); - explain insert into test_bypass_sq1 values (0,0,'test_insert2'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert2'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (0,0,'test_insert2'); - explain insert into test_bypass_sq1 values (2,2,'test_insert2'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (2,2,'test_insert2'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (2,2,'test_insert2'); - explain insert into test_bypass_sq1 values (0,0,'test_insert3'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert3'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (0,0,'test_insert3'); - explain insert into test_bypass_sq1 values (3,3,'test_insert3'); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (3,3,'test_insert3'); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (3,3,'test_insert3'); - explain insert into test_bypass_sq1(col1,col2) values (1,1); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1(col1,col2) values (1,1); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1(col1,col2) values (1,1); - explain insert into test_bypass_sq1(col1,col2) values (2,2); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1(col1,col2) values (2,2); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1(col1,col2) values (2,2); - explain insert into test_bypass_sq1(col1,col2) values (3,3); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1(col1,col2) values (3,3); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1(col1,col2) values (3,3); - explain insert into test_bypass_sq1 values (null,null,null); - QUERY PLAN -------------------------------------------------------------- + explain (costs off) insert into test_bypass_sq1 values (null,null,null); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (null,null,null); --bypass set enable_indexonlyscan=off; -explain select * from test_bypass_sq1 where col1=0 and col2=0; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (3 rows) @@ -140,11 +140,11 @@ select * from test_bypass_sq1 where col1=0 and col2=0; 0 | 0 | test_insert (3 rows) -explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2; - QUERY PLAN -------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=8) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 > 0) AND (col2 > 0)) (3 rows) @@ -160,12 +160,12 @@ select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 3 | 3 (7 rows) -explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.00..0.38 rows=1 width=8) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=8) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 > 0) AND (col2 > 0)) (4 rows) @@ -175,13 +175,13 @@ select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 1 | 1 (1 row) -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..8.28 rows=1 width=14) - -> LockRows (cost=0.00..8.28 rows=1 width=14) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (5 rows) @@ -191,12 +191,12 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 0 | 0 (1 row) -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0; - QUERY PLAN ----------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.00..8.27 rows=1 width=8) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=8) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) @@ -205,13 +205,13 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 ------+------ (0 rows) -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------ +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..8.28 rows=1 width=14) - -> LockRows (cost=0.00..8.28 rows=1 width=14) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (5 rows) @@ -223,11 +223,11 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 reset enable_indexonlyscan; --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (3 rows) @@ -239,12 +239,12 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; 0 | 0 (3 rows) -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000000827.01 rows=1 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) @@ -254,12 +254,12 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limi 0 | 0 (1 row) -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000000827.01 rows=1 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) @@ -270,41 +270,41 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limi reset enable_indexscan; --error -explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit -1; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit -1; QUERY PLAN ---------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used limit count grammar with const less than zero. - Limit (cost=0.00..8.27 rows=1 width=40) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) -explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for update limit -1; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for update limit -1; QUERY PLAN ---------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used limit count grammar with const less than zero. - Limit (cost=0.00..8.28 rows=1 width=46) - -> LockRows (cost=0.00..8.28 rows=1 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (5 rows) --bypass -explain update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) (4 rows) update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; -explain select * from test_bypass_sq1 where col1 is null and col2 is null; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col1 is null and col2 is null; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) (3 rows) @@ -314,11 +314,11 @@ select * from test_bypass_sq1 where col1 is null and col2 is null; | | test_null (1 row) -explain select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..71.41 rows=1155 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NOT NULL) AND (col2 IS NOT NULL)) (3 rows) @@ -338,11 +338,11 @@ select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not nul 3 | 3 (11 rows) -explain select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..39.92 rows=6 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NOT NULL) AND (col2 = 0)) (3 rows) @@ -354,41 +354,41 @@ select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; 0 | 0 | test_insert (3 rows) -explain update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=14) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; -explain update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = 0)) (4 rows) update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; -explain update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=10) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=10) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 2) AND (col2 = 2)) (4 rows) update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; -explain select * from test_bypass_sq1 where col1=0 and col2=-1; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=-1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 0) AND (col2 = (-1))) (3 rows) @@ -401,49 +401,49 @@ select * from test_bypass_sq1 where col1=0 and col2=-1; (3 rows) --not bypass -explain insert into test_bypass_sq1 values(0,generate_series(1,100),'test'); +explain (costs off) insert into test_bypass_sq1 values(0,generate_series(1,100),'test'); QUERY PLAN ---------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because the expression of query is not support. - Insert on test_bypass_sq1 (cost=0.00..5.01 rows=1000 width=0) - -> Result (cost=0.00..5.01 rows=1000 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) -explain select * from test_bypass_sq1 where col3 is not null; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col3 is not null; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Seq Scan on test_bypass_sq1 (cost=10000000000.00..1000000002167.00 rows=1161 width=40) + Seq Scan on test_bypass_sq1 Filter: (col3 IS NOT NULL) (3 rows) --bypass -explain update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 1) AND (col2 = 1)) (4 rows) update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; --bypass / set enable_bitmapscan=off; -explain update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..24.36 rows=6 width=10) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..24.36 rows=6 width=10) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 = 0) (4 rows) update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; -explain select * from test_bypass_sq1 where col1=0 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1=0 order by col1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..24.36 rows=6 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 = 0) (3 rows) @@ -456,11 +456,11 @@ select * from test_bypass_sq1 where col1=0 order by col1; 0 | 111 | test_update2 (4 rows) -explain select * from test_bypass_sq1 where col2=2 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col2=2 order by col1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..37.06 rows=6 width=40) + Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col2 = 2) (3 rows) @@ -472,11 +472,11 @@ select * from test_bypass_sq1 where col2=2 order by col1; 1 | 2 | test_insert (3 rows) -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (3 rows) @@ -492,12 +492,12 @@ select col1,col2 from test_bypass_sq1 where col1>0 order by col1; 3 | 3 (7 rows) -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; - QUERY PLAN ------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=0.00..0.39 rows=3 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (4 rows) @@ -509,13 +509,13 @@ select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; 1 | 2 (3 rows) -explain select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; - QUERY PLAN ------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..8.14 rows=2 width=46) - -> LockRows (cost=0.00..24.42 rows=6 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..24.36 rows=6 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 = 0) (5 rows) @@ -526,11 +526,11 @@ select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; 0 | 111 | test_update2 (2 rows) -explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col2<5 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..60.89 rows=389 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col2 < 5) (3 rows) @@ -546,11 +546,11 @@ select col1,col2 from test_bypass_sq1 where col2<5 order by col1; 3 | 3 (7 rows) -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 >= 0) AND (col2 > 0)) (3 rows) @@ -570,12 +570,12 @@ select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; 3 | 3 (11 rows) -explain select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.00..1.14 rows=3 width=40) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=40) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 >= 0) AND (col2 > 0)) (4 rows) @@ -587,13 +587,13 @@ select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; 0 | 111 | test_update2 (3 rows) -explain select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..8.28 rows=1 width=46) - -> LockRows (cost=0.00..8.28 rows=1 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 1) AND (col2 = 2)) (5 rows) @@ -605,11 +605,11 @@ select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update l --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sq1 where col1=0 order by col2; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 order by col2; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000002435.51 rows=6 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 = 0) (3 rows) @@ -622,11 +622,11 @@ select col1,col2 from test_bypass_sq1 where col1=0 order by col2; 0 | 111 (4 rows) -explain select col2,col1 from test_bypass_sq1 where col2=2 order by col1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col1 from test_bypass_sq1 where col2=2 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000003706.26 rows=6 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col2 = 2) (3 rows) @@ -638,11 +638,11 @@ select col2,col1 from test_bypass_sq1 where col2=2 order by col1; 2 | 1 (3 rows) -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000005105.76 rows=389 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (3 rows) @@ -658,11 +658,11 @@ select col1,col2 from test_bypass_sq1 where col1>0 order by col1; 3 | 3 (7 rows) -explain select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) (3 rows) @@ -672,12 +672,12 @@ select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; | (1 row) -explain select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..17634961478.96 rows=3 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000005105.76 rows=389 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (4 rows) @@ -689,11 +689,11 @@ select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; 2 | 1 (3 rows) -explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col2<5 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000006089.26 rows=389 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col2 < 5) (3 rows) @@ -709,11 +709,11 @@ select col1,col2 from test_bypass_sq1 where col2<5 order by col1; 3 | 3 (7 rows) -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000004944.01 rows=130 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 >= 0) AND (col2 > 0)) (3 rows) @@ -733,12 +733,12 @@ select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; 3 | 3 (11 rows) -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..32846153960.25 rows=3 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000004944.01 rows=130 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 >= 0) AND (col2 > 0)) (4 rows) @@ -750,12 +750,12 @@ select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 lim 0 | 111 (3 rows) -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null; + QUERY PLAN +----------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000004944.01 rows=130 width=8) - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000004944.01 rows=130 width=8) + Limit + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 >= 0) AND (col2 > 0)) (4 rows) @@ -777,20 +777,20 @@ select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 lim reset enable_indexscan; --not bypass -explain select * from test_bypass_sq1 where col1>col2; - QUERY PLAN ----------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>col2; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Seq Scan on test_bypass_sq1 (cost=10000000000.00..1000000002458.75 rows=389 width=40) + Seq Scan on test_bypass_sq1 Filter: (col1 > col2) (3 rows) -explain select * from test_bypass_sq1 where col1=3 and col2=3 for update; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where col1=3 and col2=3 for update; + QUERY PLAN +------------------------------------------------------------ [Bypass] - LockRows (cost=0.00..8.28 rows=1 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=46) + LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 3) AND (col2 = 3)) (4 rows) @@ -801,21 +801,21 @@ select * from test_bypass_sq1 where col1=3 and col2=3 for update; 3 | 3 | test_insert3 (2 rows) -explain select * from test_bypass_sq1 where col3='test_update2'; - QUERY PLAN --------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col3='test_update2'; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Seq Scan on test_bypass_sq1 (cost=10000000000.00..1000000002458.75 rows=6 width=40) + Seq Scan on test_bypass_sq1 Filter: (col3 = 'test_update2'::text) (3 rows) --bypass -explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=1.14..2.28 rows=3 width=40) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=40) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 > 0) AND (col2 > 0)) (4 rows) @@ -832,42 +832,42 @@ select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offs ------+------+------ (0 rows) -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.42..0.85 rows=3 width=46) - -> LockRows (cost=0.00..54.95 rows=389 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (5 rows) -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null; - QUERY PLAN --------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..0.42 rows=3 width=46) - -> LockRows (cost=0.00..54.95 rows=389 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (5 rows) -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 30; - QUERY PLAN --------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 30; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=4.24..4.66 rows=3 width=46) - -> LockRows (cost=0.00..54.95 rows=389 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (5 rows) -explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=1.14..49.44 rows=127 width=40) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=40) + Limit + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 > 0) AND (col2 > 0)) (4 rows) @@ -885,52 +885,52 @@ select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 off ------+------+------ (0 rows) -explain select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.42..54.95 rows=386 width=46) - -> LockRows (cost=0.00..54.95 rows=389 width=46) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=46) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (5 rows) -explain update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=42) + Update on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 3) AND (col2 = 2)) (4 rows) update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; -explain delete from test_bypass_sq1 where col1=1 and col2=1; - QUERY PLAN ----------------------------------------------------------------------------------------------- +explain (costs off) delete from test_bypass_sq1 where col1=1 and col2=1; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Delete on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=6) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=6) + Delete on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 = 1) AND (col2 = 1)) (4 rows) delete from test_bypass_sq1 where col1=1 and col2=1; -explain delete from test_bypass_sq1 where col1 is null and col2 is null; - QUERY PLAN ----------------------------------------------------------------------------------------------- +explain (costs off) delete from test_bypass_sq1 where col1 is null and col2 is null; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Delete on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=6) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=6) + Delete on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) (4 rows) delete from test_bypass_sq1 where col1 is null and col2 is null; -explain insert into test_bypass_sq1 values (null,null,null); - QUERY PLAN -------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq1 values (null,null,null); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq1 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq1 + -> Result (3 rows) insert into test_bypass_sq1 values (null,null,null); @@ -942,11 +942,11 @@ select * from test_bypass_sq1 where col1=3; 3 | 3 | test_insert3 (2 rows) -explain select col1,col2 from test_bypass_sq1 order by col1 desc; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1 desc; + QUERY PLAN +-------------------------------------------------------------------- [Bypass] - Index Only Scan Backward using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8) + Index Only Scan Backward using itest_bypass_sq1 on test_bypass_sq1 (2 rows) select col1,col2 from test_bypass_sq1 order by col1 desc; --order by is supported when ordered col is in index @@ -966,11 +966,11 @@ select col1,col2 from test_bypass_sq1 order by col1 desc; --order by is supporte 0 | 111 (12 rows) -explain select col1,col2 from test_bypass_sq1 order by col1; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (2 rows) select col1,col2 from test_bypass_sq1 order by col1; @@ -991,11 +991,11 @@ select col1,col2 from test_bypass_sq1 order by col1; (12 rows) --not bypass -explain select col1,col2 from test_bypass_sq1 order by col1,col2; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1,col2; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (2 rows) select col1,col2 from test_bypass_sq1 order by col1,col2; @@ -1015,22 +1015,22 @@ select col1,col2 from test_bypass_sq1 order by col1,col2; | (12 rows) -explain select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Sort (cost=67.79..68.76 rows=389 width=40) + Sort Sort Key: col1, col2 DESC - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=40) + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (5 rows) --bypass -explain select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (3 rows) @@ -1047,19 +1047,19 @@ select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; (7 rows) --not bypass -explain select * from test_bypass_sq1 where true; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq1 where true; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Seq Scan on test_bypass_sq1 (cost=10000000000.00..1000000002167.00 rows=1167 width=40) + Seq Scan on test_bypass_sq1 (2 rows) --bypass -explain select col1, col2 from test_bypass_sq1 where true order by col1; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sq1 where true order by col1; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8) + Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (2 rows) select col1, col2 from test_bypass_sq1 where true order by col1; @@ -1113,12 +1113,12 @@ select col1, col2 from test_bypass_sq1 order by col1 desc; 0 | 111 (12 rows) -explain insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0; + QUERY PLAN +-------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query combines insert operator with others. - Insert on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=40) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=40) + Insert on test_bypass_sq1 + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 Index Cond: (col1 > 0) (4 rows) @@ -1129,31 +1129,31 @@ NOTICE: table "test_bypass_sq2" does not exist, skipping create table test_bypass_sq2(col1 int not null, col2 int); create index itest_bypass_sq2 on test_bypass_sq2(col1); --bypass -explain insert into test_bypass_sq2(col1) values (0); - QUERY PLAN -------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq2(col1) values (0); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq2 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq2 + -> Result (3 rows) insert into test_bypass_sq2(col1) values (0); --error -explain insert into test_bypass_sq2(col1) values (null); - QUERY PLAN -------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq2(col1) values (null); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq2 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq2 + -> Result (3 rows) --bypass -explain insert into test_bypass_sq2(col1,col2) values (1,1); - QUERY PLAN -------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq2(col1,col2) values (1,1); + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq2 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq2 + -> Result (3 rows) insert into test_bypass_sq2(col1,col2) values (1,1); @@ -1162,31 +1162,31 @@ insert into test_bypass_sq2(col1,col2) values (-1,-1); insert into test_bypass_sq2(col1,col2) values (1,1); insert into test_bypass_sq2(col1,col2) values (2,2); insert into test_bypass_sq2(col1,col2) values (3,3); -explain insert into test_bypass_sq2(col1,col2) values (null,null);--error - QUERY PLAN -------------------------------------------------------------- +explain (costs off) insert into test_bypass_sq2(col1,col2) values (null,null);--error + QUERY PLAN +--------------------------- [Bypass] - Insert on test_bypass_sq2 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq2 + -> Result (3 rows) --bypass set enable_indexonlyscan=off; -explain update test_bypass_sq2 set col2 = col2+1 where col1 = 0; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sq2 set col2 = col2+1 where col1 = 0; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Update on test_bypass_sq2 (cost=0.00..36.47 rows=11 width=14) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..36.47 rows=11 width=14) + Update on test_bypass_sq2 + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 = 0) (4 rows) update test_bypass_sq2 set col2 = col2+1 where col1 = 0; -explain select * from test_bypass_sq2 where col1 = 0 order by col1; - QUERY PLAN ------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 = 0 order by col1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..36.44 rows=11 width=8) + Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 = 0) (3 rows) @@ -1196,11 +1196,11 @@ select * from test_bypass_sq2 where col1 = 0 order by col1; 0 | (1 row) -explain select * from test_bypass_sq2 where col1 >= 0 order by col1; - QUERY PLAN -------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 >= 0 order by col1; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..56.78 rows=716 width=8) + Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 >= 0) (3 rows) @@ -1215,12 +1215,12 @@ select * from test_bypass_sq2 where col1 >= 0 order by col1; 3 | 3 (6 rows) -explain select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.00..0.32 rows=4 width=8) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..56.78 rows=716 width=8) + Limit + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 >= 0) (4 rows) @@ -1233,13 +1233,13 @@ select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; 2 | 2 (4 rows) -explain select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.00..3.32 rows=1 width=14) - -> LockRows (cost=0.00..36.55 rows=11 width=14) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..36.44 rows=11 width=14) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 = 1) (5 rows) @@ -1249,12 +1249,12 @@ select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; 1 | 1 (1 row) -explain select col1 from test_bypass_sq2 order by col1 limit 2; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select col1 from test_bypass_sq2 order by col1 limit 2; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.00..0.07 rows=2 width=4) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..80.49 rows=2149 width=4) + Limit + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (3 rows) select col1 from test_bypass_sq2 order by col1 limit 2; @@ -1264,12 +1264,12 @@ select col1 from test_bypass_sq2 order by col1 limit 2; 0 (2 rows) -explain select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; - QUERY PLAN -------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; + QUERY PLAN +------------------------------------------------------------ [Bypass] - Limit (cost=0.16..0.32 rows=2 width=8) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..56.78 rows=716 width=8) + Limit + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 > 0) (4 rows) @@ -1280,53 +1280,53 @@ select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; 3 | 3 (2 rows) -explain select * from test_bypass_sq2 where col1 > 0 order by col1 for update limit 2 offset 2; - QUERY PLAN --------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col1 > 0 order by col1 for update limit 2 offset 2; + QUERY PLAN +------------------------------------------------------------------ [Bypass] - Limit (cost=0.18..0.36 rows=2 width=14) - -> LockRows (cost=0.00..63.94 rows=716 width=14) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..56.78 rows=716 width=14) + Limit + -> LockRows + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 > 0) (5 rows) reset enable_indexonlyscan; --not bypass -explain select * from test_bypass_sq2 where col2 is null; - QUERY PLAN --------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 where col2 is null; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Seq Scan on test_bypass_sq2 (cost=10000000000.00..1000000003149.00 rows=11 width=8) + Seq Scan on test_bypass_sq2 Filter: (col2 IS NULL) (3 rows) -explain select * from test_bypass_sq2 where col1 = 0 and col2 = 0; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq2 where col1 = 0 and col2 = 0; + QUERY PLAN +-------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used indexscan with qual. - Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..36.47 rows=1 width=8) + Index Scan using itest_bypass_sq2 on test_bypass_sq2 Index Cond: (col1 = 0) Filter: (col2 = 0) (4 rows) -explain select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------- +explain (costs off) select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Hash Join (cost=80.34..307.71 rows=12539 width=36) + Hash Join Hash Cond: (t2.col1 = t1.col1) - -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 t2 (cost=0.00..80.49 rows=2149 width=8) - -> Hash (cost=65.76..65.76 rows=1167 width=36) - -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 t1 (cost=0.00..65.76 rows=1167 width=36) + -> Index Scan using itest_bypass_sq2 on test_bypass_sq2 t2 + -> Hash + -> Index Scan using itest_bypass_sq1 on test_bypass_sq1 t1 (6 rows) -explain select count(*),col1 from test_bypass_sq1 group by col1; - QUERY PLAN -------------------------------------------------------------------------------------------------------- +explain (costs off) select count(*),col1 from test_bypass_sq1 group by col1; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - GroupAggregate (cost=0.00..73.59 rows=200 width=12) + GroupAggregate Group By Key: col1 - -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=4) + -> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (4 rows) --bypass (order by is supported when ordered col is in index) @@ -1355,13 +1355,13 @@ select col1 from test_bypass_sq2 order by col1; (7 rows) --not bypass -explain select * from test_bypass_sq2 order by col1,col2; - QUERY PLAN ----------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq2 order by col1,col2; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Sort (cost=1000000003267.94..1000000003273.31 rows=2149 width=8) + Sort Sort Key: col1, col2 - -> Seq Scan on test_bypass_sq2 (cost=10000000000.00..1000000003149.00 rows=2149 width=8) + -> Seq Scan on test_bypass_sq2 (4 rows) -- @@ -1376,21 +1376,21 @@ insert into test_bypass_sq3(col2,col3) values(1,default); insert into test_bypass_sq3 values(2,3,null); insert into test_bypass_sq3 values (3,3,null); --not bypass -explain insert into test_bypass_sq3 values(3,3,current_timestamp); +explain (costs off) insert into test_bypass_sq3 values(3,3,current_timestamp); QUERY PLAN ---------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because the expression of query is not support. - Insert on test_bypass_sq3 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq3 + -> Result (3 rows) -explain select * from test_bypass_sq3 where col1 = 1 order by col2; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sq3 where col1 = 1 order by col2; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Sort (cost=32.55..32.57 rows=9 width=16) + Sort Sort Key: col2 - -> Index Scan using itest_bypass_sq3 on test_bypass_sq3 (cost=0.00..32.41 rows=9 width=16) + -> Index Scan using itest_bypass_sq3 on test_bypass_sq3 Index Cond: (col1 = 1) (5 rows) @@ -1429,11 +1429,11 @@ insert into test_bypass_sq4 values (55,55,null); insert into test_bypass_sq4 values (55,null,55); insert into test_bypass_sq4 values (55,null,null); insert into test_bypass_sq4 values (null,null,null); -explain select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; - QUERY PLAN --------------------------------------------------------------------------------------------- +explain (costs off) select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..69.32 rows=648 width=12) + Index Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: (col2 > 22) (3 rows) @@ -1450,11 +1450,11 @@ select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; | 55 | 55 (8 rows) -explain select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; - QUERY PLAN ------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; + QUERY PLAN +------------------------------------------------------ [Bypass] - Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..8.27 rows=1 width=12) + Index Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: ((col3 = 32) AND (col2 = 22)) (3 rows) @@ -1464,11 +1464,11 @@ select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; 11 | 22 | 32 (1 row) -explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2; - QUERY PLAN ------------------------------------------------------------------------------------------------- +explain (costs off) select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..52.89 rows=216 width=8) + Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: ((col3 >= 33) AND (col2 >= 22)) (3 rows) @@ -1492,21 +1492,21 @@ select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order 55 | 55 | 55 (4 rows) -explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update; + QUERY PLAN +------------------------------------------------------------ [Bypass] - LockRows (cost=0.00..55.05 rows=216 width=14) - -> Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..52.89 rows=216 width=14) + LockRows + -> Index Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: ((col3 >= 33) AND (col2 >= 22)) (4 rows) -explain select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update; - QUERY PLAN --------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update; + QUERY PLAN +------------------------------------------------------------ [Bypass] - LockRows (cost=0.00..55.05 rows=216 width=14) - -> Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..52.89 rows=216 width=14) + LockRows + -> Index Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: ((col3 >= 34) AND (col2 >= 22)) (4 rows) @@ -1517,11 +1517,11 @@ select col2,col3,col2 from test_bypass_sq4 where col3 is null and col2 is null o | | (2 rows) -explain select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; - QUERY PLAN ------------------------------------------------------------------------------------------------ +explain (costs off) select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; + QUERY PLAN +----------------------------------------------------------- [Bypass] - Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..32.45 rows=10 width=8) + Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 Index Cond: ((col3 IS NULL) AND (col2 IS NOT NULL)) (3 rows) @@ -1531,11 +1531,11 @@ select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; 55 | (1 row) -explain select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc; + QUERY PLAN +-------------------------------------------------------------------- [Bypass] - Index Only Scan Backward using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..82.11 rows=1935 width=8) + Index Only Scan Backward using itest_bypass_sq4 on test_bypass_sq4 Index Cond: (col3 IS NOT NULL) (3 rows) @@ -1740,12 +1740,12 @@ create type complextype AS (f1 int, f2 text); create table test_bypass_sq6(col1 int, col2 complextype,col3 text); create index itest_bypass_sq6 on test_bypass_sq6(col1,col3); --not bypass -explain insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text); +explain (costs off) insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text); QUERY PLAN ---------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used unsupported DML target type. - Insert on test_bypass_sq6 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sq6 + -> Result (3 rows) -- just insert @@ -1793,11 +1793,11 @@ select col1, col3 from test_bypass_sq6 where true; (1 row) --notbypass -explain update test_bypass_sq6 set col2=ROW(2,'Ruby2'::text) where col1 = 1; - QUERY PLAN ------------------------------------------------------------------------------------------------- - Update on test_bypass_sq6 (cost=0.00..20.32 rows=4 width=42) - -> Index Scan using itest_bypass_sq6 on test_bypass_sq6 (cost=0.00..20.32 rows=4 width=42) +explain (costs off) update test_bypass_sq6 set col2=ROW(2,'Ruby2'::text) where col1 = 1; + QUERY PLAN +------------------------------------------------------------ + Update on test_bypass_sq6 + -> Index Scan using itest_bypass_sq6 on test_bypass_sq6 Index Cond: (col1 = 1) (3 rows) @@ -1860,38 +1860,38 @@ create table test_bypass_sq8(col1 int, col2 int, col3 text); create index itest_bypass_sq8 on test_bypass_sq8(col1,col2); create trigger tri_bypass after insert on test_bypass_sq8 for each row execute procedure tri_bypass(); insert into test_bypass_sq8 values(1,1,'test'); -explain select * from test_bypass_sq8 where col1 = 1; - QUERY PLAN ------------------------------------------------------------------------------------------- - [No Bypass]reason: Bypass not executed because query's relation is not support. - Index Scan using itest_bypass_sq8 on test_bypass_sq8 (cost=0.00..24.36 rows=6 width=40) - Index Cond: (col1 = 1) -(3 rows) - -explain update test_bypass_sq8 set col2 = 2 where col1 = 1; - QUERY PLAN ------------------------------------------------------------------------------------------------- - [No Bypass]reason: Bypass not executed because query's relation is not support. - Update on test_bypass_sq8 (cost=0.00..24.36 rows=6 width=42) - -> Index Scan using itest_bypass_sq8 on test_bypass_sq8 (cost=0.00..24.36 rows=6 width=42) - Index Cond: (col1 = 1) -(4 rows) - -explain delete test_bypass_sq8 where col1 = 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ - [No Bypass]reason: Bypass not executed because query's relation is not support. - Delete on test_bypass_sq8 (cost=0.00..24.36 rows=6 width=6) - -> Index Scan using itest_bypass_sq8 on test_bypass_sq8 (cost=0.00..24.36 rows=6 width=6) - Index Cond: (col1 = 1) -(4 rows) - -explain insert into test_bypass_sq8 values(2,2,'testinsert'); +explain (costs off) select * from test_bypass_sq8 where col1 = 1; QUERY PLAN --------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query's relation is not support. - Insert on test_bypass_sq8 (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Index Scan using itest_bypass_sq8 on test_bypass_sq8 + Index Cond: (col1 = 1) +(3 rows) + +explain (costs off) update test_bypass_sq8 set col2 = 2 where col1 = 1; + QUERY PLAN +--------------------------------------------------------------------------------- + [No Bypass]reason: Bypass not executed because query's relation is not support. + Update on test_bypass_sq8 + -> Index Scan using itest_bypass_sq8 on test_bypass_sq8 + Index Cond: (col1 = 1) +(4 rows) + +explain (costs off) delete test_bypass_sq8 where col1 = 1; + QUERY PLAN +--------------------------------------------------------------------------------- + [No Bypass]reason: Bypass not executed because query's relation is not support. + Delete on test_bypass_sq8 + -> Index Scan using itest_bypass_sq8 on test_bypass_sq8 + Index Cond: (col1 = 1) +(4 rows) + +explain (costs off) insert into test_bypass_sq8 values(2,2,'testinsert'); + QUERY PLAN +--------------------------------------------------------------------------------- + [No Bypass]reason: Bypass not executed because query's relation is not support. + Insert on test_bypass_sq8 + -> Result (3 rows) set opfusion_debug_mode=off; @@ -1912,7 +1912,7 @@ create view v_test as select * from test; CREATE OR REPLACE RULE v_delete as ON DELETE TO v_test DO INSTEAD NOTHING; delete from v_test; set explain_perf_mode=pretty; -explain delete from v_test; +explain (costs off) delete from v_test; QUERY PLAN --------------------------- Query rewrites to nothing diff --git a/src/test/regress/expected/force_vector_engine2.out b/src/test/regress/expected/force_vector_engine2.out index 051f09ebc..c2b2a1346 100644 --- a/src/test/regress/expected/force_vector_engine2.out +++ b/src/test/regress/expected/force_vector_engine2.out @@ -14,37 +14,37 @@ partition by range(id) ( ); insert into force_vector_partition values(generate_series(1, 10000), generate_series(1, 2000), generate_series(1, 5000)); analyze force_vector_partition; -explain (analyze on, timing off) select /*+ set(try_vector_engine_strategy force) */ id, val1*2, val2+val1 as val3 from force_vector_test where id < 5000 and val1 < 500 order by id limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------- - Row Adapter (cost=277.80..277.80 rows=10 width=13) (actual rows=10 loops=1) - -> Vector Limit (cost=277.77..277.80 rows=10 width=13) (actual rows=10 loops=1) - -> Vector Sort (cost=277.77..284.02 rows=2500 width=13) (actual rows=10 loops=1) +explain (analyze on, timing off, costs off) select /*+ set(try_vector_engine_strategy force) */ id, val1*2, val2+val1 as val3 from force_vector_test where id < 5000 and val1 < 500 order by id limit 10; + QUERY PLAN +----------------------------------------------------------------------------------- + Row Adapter (actual rows=10 loops=1) + -> Vector Limit (actual rows=10 loops=1) + -> Vector Sort (actual rows=10 loops=1) Sort Key: id - Sort Method: top-N heapsort Memory: 4kB - -> Vector Adapter(type: BATCH MODE) (cost=223.75..223.75 rows=2500 width=13) (actual rows=2495 loops=1) +--? Sort Method: top-N heapsort Memory:.* + -> Vector Adapter(type: BATCH MODE) (actual rows=2495 loops=1) Filter: ((id < 5000) AND (val1 < 500)) Rows Removed by Filter: 7505 - -> Seq Scan on force_vector_test (cost=0.00..223.75 rows=2500 width=13) (actual rows=10000 loops=1) ---?.* + -> Seq Scan on force_vector_test (actual rows=10000 loops=1) +--? Total runtime:.* (10 rows) -explain (analyze on, timing off) select /*+ set(try_vector_engine_strategy force) */ id, avg(val1), sum(val2) from force_vector_partition group by id order by id limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------- - Row Adapter (cost=596.12..596.12 rows=10 width=76) (actual rows=10 loops=1) - -> Vector Limit (cost=596.10..596.12 rows=10 width=76) (actual rows=10 loops=1) - -> Vector Sort (cost=596.10..621.10 rows=10000 width=76) (actual rows=10 loops=1) +explain (analyze on, timing off, costs off) select /*+ set(try_vector_engine_strategy force) */ id, avg(val1), sum(val2) from force_vector_partition group by id order by id limit 10; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Row Adapter (actual rows=10 loops=1) + -> Vector Limit (actual rows=10 loops=1) + -> Vector Sort (actual rows=10 loops=1) Sort Key: id - Sort Method: top-N heapsort Memory: 5kB - -> Vector Hash Aggregate (cost=255.00..380.00 rows=10000 width=76) (actual rows=10000 loops=1) +--? Sort Method: top-N heapsort Memory:.* + -> Vector Hash Aggregate (actual rows=10000 loops=1) Group By Key: id - -> Vector Partition Iterator (cost=0.00..155.00 rows=10000 width=12) (actual rows=10000 loops=1) + -> Vector Partition Iterator (actual rows=10000 loops=1) Iterations: 5 - -> Vector Adapter(type: BATCH MODE) (cost=155.00..155.00 rows=10000 width=12) (actual rows=10000 loops=5) - -> Partitioned Seq Scan on force_vector_partition (cost=0.00..155.00 rows=10000 width=12) (actual rows=10000 loops=5) + -> Vector Adapter(type: BATCH MODE) (actual rows=10000 loops=5) + -> Partitioned Seq Scan on force_vector_partition (actual rows=10000 loops=5) Selected Partitions: 1..5 ---?.* +--? Total runtime:.* (13 rows) drop table force_vector_test; diff --git a/src/test/regress/expected/sqlbypass_partition.out b/src/test/regress/expected/sqlbypass_partition.out index 259876d5f..132233ee2 100755 --- a/src/test/regress/expected/sqlbypass_partition.out +++ b/src/test/regress/expected/sqlbypass_partition.out @@ -23,123 +23,123 @@ partition test_bypass_sql_partition_8 values less than(80) ); create index itest_bypass_sql_partition on test_bypass_sql_partition(col1,col2) local; --insert -explain insert into test_bypass_sql_partition values (0,0,'test_insert'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (0,0,'test_insert'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (0,0,'test_insert'); -explain insert into test_bypass_sql_partition values (0,1,'test_insert'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (0,1,'test_insert'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (0,1,'test_insert'); -explain insert into test_bypass_sql_partition values (11,1,'test_insert'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (11,1,'test_insert'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (11,1,'test_insert'); -explain insert into test_bypass_sql_partition values (11,2,'test_insert'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (11,2,'test_insert'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (11,2,'test_insert'); -explain insert into test_bypass_sql_partition values (0,10,'test_insert2'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (0,10,'test_insert2'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (0,10,'test_insert2'); -explain insert into test_bypass_sql_partition values (2,12,'test_insert2'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (2,12,'test_insert2'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (2,12,'test_insert2'); -explain insert into test_bypass_sql_partition values (30,0,'test_insert3'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (30,0,'test_insert3'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (30,0,'test_insert3'); -explain insert into test_bypass_sql_partition values (3,3,'test_insert3'); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (3,3,'test_insert3'); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (3,3,'test_insert3'); -explain insert into test_bypass_sql_partition(col1,col2) values (1,1); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (1,1); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition(col1,col2) values (1,1); -explain insert into test_bypass_sql_partition(col1,col2) values (22,2); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (22,2); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition(col1,col2) values (22,2); -explain insert into test_bypass_sql_partition(col1,col2) values (33,3); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (33,3); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition(col1,col2) values (33,3); --error -explain insert into test_bypass_sql_partition values (null,null,null); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (null,null,null); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (null,null,null); ERROR: inserted partition key does not map to any table partition --nobypass -explain insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); +explain (costs off) insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); QUERY PLAN ---------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because the expression of query is not support. - Insert on test_bypass_sql_partition (cost=0.00..5.01 rows=1000 width=0) - -> Result (cost=0.00..5.01 rows=1000 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); @@ -161,13 +161,13 @@ create index itest_bypass_sql_partition on test_bypass_sql_partition(col1,col2) insert into test_bypass_sql_partition select generate_series(0,79,1), generate_series(0,100,10), repeat('a',7); --bypass set enable_indexonlyscan=off; -explain select * from test_bypass_sql_partition where col1=0 and col2=0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0; + QUERY PLAN +-------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=0.00..8.27 rows=1 width=40) + Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 0) AND (col2 = 0)) Selected Partitions: 1 (6 rows) @@ -178,13 +178,13 @@ select * from test_bypass_sql_partition where col1=0 and col2=0; 0 | 0 | aaaaaaa (1 row) -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 and col2 <= 20 order by col1,col2; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 and col2 <= 20 order by col1,col2; + QUERY PLAN +-------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=0.00..8.35 rows=1 width=8) + Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.35 rows=1 width=8) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 10) AND (col1 < 20) AND (col2 > 0) AND (col2 <= 20)) Selected Partitions: 2 (6 rows) @@ -212,14 +212,14 @@ select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and co 19 | 20 (18 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 1; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..6.17 rows=1 width=8) - -> Partition Iterator (cost=0.00..12.35 rows=2 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..12.35 rows=2 width=8) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 10) AND (col1 < 20) AND (col2 > 0)) Selected Partitions: 2 (7 rows) @@ -230,15 +230,15 @@ select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and co 11 | 10 (1 row) -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 for update limit 1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 for update limit 1; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..6.18 rows=1 width=18) - -> LockRows (cost=0.00..12.37 rows=2 width=18) - -> Partition Iterator (cost=0.00..12.35 rows=2 width=18) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..12.35 rows=2 width=18) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 10) AND (col1 < 20) AND (col2 > 0)) Selected Partitions: 2 (8 rows) @@ -249,14 +249,14 @@ select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and co 11 | 10 (1 row) -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 0; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..6.17 rows=1 width=8) - -> Partition Iterator (cost=0.00..12.35 rows=2 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..12.35 rows=2 width=8) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 10) AND (col1 < 20) AND (col2 > 0)) Selected Partitions: 2 (7 rows) @@ -266,15 +266,15 @@ select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and co ------+------ (0 rows) -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order by col1,col2 for update limit 0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order by col1,col2 for update limit 0; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..8.28 rows=1 width=18) - -> LockRows (cost=0.00..8.28 rows=1 width=18) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=18) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=18) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 10) AND (col2 = 0)) Selected Partitions: 2 (8 rows) @@ -284,13 +284,13 @@ select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order b ------+------ (0 rows) -explain select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 is not null order by col1,col2; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 is not null order by col1,col2; + QUERY PLAN +-------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Partition Iterator (cost=0.00..191.41 rows=1155 width=8) + Partition Iterator Iterations: 8 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..191.41 rows=1155 width=8) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NOT NULL) AND (col2 IS NOT NULL)) Selected Partitions: 1..8 (6 rows) @@ -1180,13 +1180,13 @@ select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 79 | 100 (880 rows) -explain select * from test_bypass_sql_partition where col1 is not null and col2 = 0 order by col1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1 is not null and col2 = 0 order by col1; + QUERY PLAN +-------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Partition Iterator (cost=0.00..99.92 rows=6 width=40) + Partition Iterator Iterations: 8 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..99.92 rows=6 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NOT NULL) AND (col2 = 0)) Selected Partitions: 1..8 (6 rows) @@ -1276,13 +1276,13 @@ select * from test_bypass_sql_partition where col1 is not null and col2 = 0 orde 79 | 0 | aaaaaaa (80 rows) -explain select * from test_bypass_sql_partition where col1=0 and col2=-1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=-1; + QUERY PLAN +-------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=0.00..8.27 rows=1 width=40) + Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 0) AND (col2 = (-1))) Selected Partitions: 1 (6 rows) @@ -1295,13 +1295,13 @@ select * from test_bypass_sql_partition where col1=0 and col2=-1; reset enable_indexonlyscan; --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; + QUERY PLAN +------------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000000827.01 rows=1 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 10) AND (col2 = 10)) Selected Partitions: 2 (6 rows) @@ -1312,14 +1312,14 @@ select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; 10 | 10 (1 row) -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 1; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 1; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000000827.01 rows=1 width=8) - -> Partition Iterator (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000000827.01 rows=1 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 10) AND (col2 = 10)) Selected Partitions: 2 (7 rows) @@ -1330,14 +1330,14 @@ select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order 10 | 10 (1 row) -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 0; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 0; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000000827.01 rows=1 width=8) - -> Partition Iterator (cost=10000000000.00..1000000000827.01 rows=1 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000000827.01 rows=1 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 10) AND (col2 = 10)) Selected Partitions: 2 (7 rows) @@ -1349,29 +1349,29 @@ select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order reset enable_indexscan; --error -explain select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; + QUERY PLAN +---------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used limit count grammar with const less than zero. - Limit (cost=0.00..8.27 rows=1 width=40) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=40) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 0) AND (col2 = 0)) Selected Partitions: 1 (7 rows) select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; ERROR: LIMIT must not be negative -explain select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; + QUERY PLAN +---------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query used limit count grammar with const less than zero. - Limit (cost=0.00..8.28 rows=1 width=50) - -> LockRows (cost=0.00..8.28 rows=1 width=50) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 0) AND (col2 = 0)) Selected Partitions: 1 (8 rows) @@ -1379,13 +1379,13 @@ explain select * from test_bypass_sql_partition where col1=0 and col2=0 order by select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; ERROR: LIMIT must not be negative --nobypass -explain select * from test_bypass_sql_partition where col1 is null and col2 is null; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1 is null and col2 is null; + QUERY PLAN +-------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in zero partition. - Partition Iterator (cost=0.00..8.27 rows=1 width=40) + Partition Iterator Iterations: 0 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) Selected Partitions: NONE (6 rows) @@ -1410,14 +1410,14 @@ select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 10 | 90 (10 rows) -explain select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 order by col1 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..28.37 rows=6 width=8) - -> Partition Iterator (cost=0.00..28.37 rows=6 width=8) + Limit + -> Partition Iterator Iterations: 3 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..28.37 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 <= 30) AND (col1 >= 10)) Selected Partitions: 2..4 (7 rows) @@ -1437,14 +1437,14 @@ select col1, col2 from test_bypass_sql_partition order by col1 limit 10; 0 | 90 (10 rows) -explain select col1, col2 from test_bypass_sql_partition order by col1 limit 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sql_partition order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..1.59 rows=10 width=8) - -> Partition Iterator (cost=0.00..185.76 rows=1167 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..185.76 rows=1167 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Selected Partitions: 1..8 (6 rows) @@ -1463,14 +1463,14 @@ select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 li 1 | 90 (10 rows) -explain select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..3.47 rows=10 width=8) - -> Partition Iterator (cost=0.00..135.06 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..135.06 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 > 0) Selected Partitions: 1..8 (7 rows) @@ -1490,113 +1490,113 @@ select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 l 0 | 90 (10 rows) -explain select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 limit 10; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..1.83 rows=10 width=8) - -> Partition Iterator (cost=0.00..71.06 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 2 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..71.06 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 < 20) Selected Partitions: 1..2 (7 rows) --update --bypass -explain update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=0 and col2=0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=0 and col2=0; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Update on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=18) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=18) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=18) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 0) AND (col2 = 0)) Selected Partitions: 1 (7 rows) update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=10 and col2=0; -explain update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Update on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=14) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=14) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=14) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 20) AND (col2 = 2)) Selected Partitions: 3 (7 rows) update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; -explain update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Update on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=46) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=46) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=46) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 1) AND (col2 = 10)) Selected Partitions: 1 (7 rows) update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; --not bypass -explain insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); +explain (costs off) insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); QUERY PLAN ---------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because the expression of query is not support. - Insert on test_bypass_sql_partition (cost=0.00..5.01 rows=1000 width=0) - -> Result (cost=0.00..5.01 rows=1000 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) -explain select * from test_bypass_sql_partition where col3 is not null; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col3 is not null; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Partition Iterator (cost=10000000000.00..1000000002167.00 rows=1161 width=40) + Partition Iterator Iterations: 8 - -> Partitioned Seq Scan on test_bypass_sql_partition (cost=10000000000.00..1000000002167.00 rows=1161 width=40) + -> Partitioned Seq Scan on test_bypass_sql_partition Filter: (col3 IS NOT NULL) Selected Partitions: 1..8 (6 rows) -explain update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in zero partition. - Update on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=18) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=18) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=18) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) Selected Partitions: NONE (7 rows) update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; --bypass -explain update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Update on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=14) - -> Partition Iterator (cost=0.00..24.36 rows=6 width=14) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=14) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 = 0) Selected Partitions: 1 (7 rows) update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; -explain select * from test_bypass_sql_partition where col1=0 order by col1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 order by col1; + QUERY PLAN +-------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=0.00..24.36 rows=6 width=40) + Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 = 0) Selected Partitions: 1 (6 rows) @@ -1617,15 +1617,15 @@ select * from test_bypass_sql_partition where col1=0 order by col1; 0 | 111 | test_update2 (11 rows) -explain select * from test_bypass_sql_partition where col1=0 order by col1 for update limit 2; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=0 order by col1 for update limit 2; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..8.14 rows=2 width=50) - -> LockRows (cost=0.00..24.42 rows=6 width=50) - -> Partition Iterator (cost=0.00..24.36 rows=6 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 = 0) Selected Partitions: 1 (8 rows) @@ -1637,15 +1637,15 @@ select * from test_bypass_sql_partition where col1=0 order by col1 for update li 0 | 111 | test_update2 (2 rows) -explain select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 for update limit 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 for update limit 1; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..8.28 rows=1 width=50) - -> LockRows (cost=0.00..8.28 rows=1 width=50) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 1) AND (col2 = 20)) Selected Partitions: 1 (8 rows) @@ -1657,13 +1657,13 @@ select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 f (1 row) --nobypass -explain select * from test_bypass_sql_partition where col2=20 order by col1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col2=20 order by col1; + QUERY PLAN +-------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Partition Iterator (cost=0.00..97.06 rows=6 width=40) + Partition Iterator Iterations: 8 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..97.06 rows=6 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col2 = 20) Selected Partitions: 1..8 (6 rows) @@ -1752,14 +1752,14 @@ select * from test_bypass_sql_partition where col2=20 order by col1; 79 | 20 | aaaaaaa (79 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..3.47 rows=10 width=8) - -> Partition Iterator (cost=0.00..135.06 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..135.06 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 > 0) Selected Partitions: 1..8 (7 rows) @@ -1779,14 +1779,14 @@ select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 1 | 90 (10 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 3; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..1.04 rows=3 width=8) - -> Partition Iterator (cost=0.00..135.06 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..135.06 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 > 0) Selected Partitions: 1..8 (7 rows) @@ -1799,14 +1799,14 @@ select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 1 | 20 (3 rows) -explain select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..4.65 rows=10 width=8) - -> Partition Iterator (cost=0.00..180.89 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..180.89 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col2 < 50) Selected Partitions: 1..8 (7 rows) @@ -1826,14 +1826,14 @@ select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limi 2 | 40 (10 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..10.26 rows=10 width=8) - -> Partition Iterator (cost=0.00..133.44 rows=130 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..133.44 rows=130 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 >= 0) AND (col2 > 0)) Selected Partitions: 1..8 (7 rows) @@ -1853,14 +1853,14 @@ select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order b 0 | 111 (10 rows) -explain select * from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 3; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 3; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..3.08 rows=3 width=40) - -> Partition Iterator (cost=0.00..133.44 rows=130 width=40) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..133.44 rows=130 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 >= 0) AND (col2 > 0)) Selected Partitions: 1..8 (7 rows) @@ -1890,13 +1890,13 @@ create index itest_bypass_sql_partition on test_bypass_sql_partition(col1,col2) insert into test_bypass_sql_partition select generate_series(0,79,1), generate_series(0,100,10), repeat('a',7); --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; + QUERY PLAN +------------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=10000000000.00..1000000002435.51 rows=6 width=8) + Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000002435.51 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 = 0) Selected Partitions: 1 (6 rows) @@ -1917,14 +1917,14 @@ select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; 0 | 100 (11 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000002437.01 rows=6 width=8) - -> Partition Iterator (cost=10000000000.00..1000000002437.01 rows=6 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000002437.01 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (7 rows) @@ -1944,14 +1944,14 @@ select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order b 1 | 90 (10 rows) -explain select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 3; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..505000001218.50 rows=3 width=8) - -> Partition Iterator (cost=10000000000.00..1000000002437.01 rows=6 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000002437.01 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (7 rows) @@ -1964,14 +1964,14 @@ select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order b 20 | 1 (3 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit 3; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000001234.51 rows=2 width=8) - -> Partition Iterator (cost=10000000000.00..1000000001234.51 rows=2 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000001234.51 rows=2 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 >= 0) AND (col1 < 10) AND (col2 > 0)) Selected Partitions: 1 (7 rows) @@ -1984,14 +1984,14 @@ select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and co 0 | 30 (3 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit null; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit null; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=10000000000.00..1000000001234.51 rows=2 width=8) - -> Partition Iterator (cost=10000000000.00..1000000001234.51 rows=2 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000001234.51 rows=2 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 >= 0) AND (col1 < 10) AND (col2 > 0)) Selected Partitions: 1 (7 rows) @@ -2102,14 +2102,14 @@ select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and co (100 rows) --nobypass -explain select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=10000000000.00..1000000009706.31 rows=6 width=8) - -> Partition Iterator (cost=10000000000.00..1000000009706.31 rows=6 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000009706.31 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col2 = 2) Selected Partitions: 1..8 (7 rows) @@ -2119,14 +2119,14 @@ select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit ------+------ (0 rows) -explain select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is null limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is null limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in zero partition. - Limit (cost=10000000000.00..1000000000827.00 rows=1 width=8) - -> Partition Iterator (cost=10000000000.00..1000000000827.00 rows=1 width=8) + Limit + -> Partition Iterator Iterations: 0 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000000827.00 rows=1 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) Selected Partitions: NONE (7 rows) @@ -2136,14 +2136,14 @@ select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is n ------+------ (0 rows) -explain select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------ +explain (costs off) select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=10000000000.00..35449871930.32 rows=10 width=8) - -> Partition Iterator (cost=10000000000.00..1000000018089.31 rows=389 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000018089.31 rows=389 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col2 < 5) Selected Partitions: 1..8 (7 rows) @@ -2163,14 +2163,14 @@ select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 9 | 0 (10 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and col2>0 order by col1 limit 10; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and col2>0 order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=10000000000.00..1000000001234.52 rows=2 width=8) - -> Partition Iterator (cost=10000000000.00..1000000001234.52 rows=2 width=8) + Limit + -> Partition Iterator Iterations: 2 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=10000000000.00..1000000001234.52 rows=2 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 >= 0) AND (col1 <= 10) AND (col2 > 0)) Selected Partitions: 1..2 (7 rows) @@ -2192,26 +2192,26 @@ select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and c reset enable_indexscan; --nobypass -explain select * from test_bypass_sql_partition where col1>col2 limit 10; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>col2 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Limit (cost=10000000000.00..35449871528.50 rows=10 width=40) - -> Partition Iterator (cost=10000000000.00..1000000002458.75 rows=389 width=40) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Seq Scan on test_bypass_sql_partition (cost=10000000000.00..1000000002458.75 rows=389 width=40) + -> Partitioned Seq Scan on test_bypass_sql_partition Filter: (col1 > col2) Selected Partitions: 1..8 (7 rows) -explain select * from test_bypass_sql_partition where col1=3 and col2=3 for update; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1=3 and col2=3 for update; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - LockRows (cost=0.00..8.28 rows=1 width=50) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=50) + LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 3) AND (col2 = 3)) Selected Partitions: 1 (7 rows) @@ -2221,25 +2221,25 @@ select * from test_bypass_sql_partition where col1=3 and col2=3 for update; ------+------+------ (0 rows) -explain select * from test_bypass_sql_partition where col3='test_update2'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col3='test_update2'; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Partition Iterator (cost=10000000000.00..1000000002458.75 rows=6 width=40) + Partition Iterator Iterations: 8 - -> Partitioned Seq Scan on test_bypass_sql_partition (cost=10000000000.00..1000000002458.75 rows=6 width=40) + -> Partitioned Seq Scan on test_bypass_sql_partition Filter: (col3 = 'test_update2'::text) Selected Partitions: 1..8 (6 rows) -explain select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 limit 3 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 limit 3 offset 3; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=12.35..12.35 rows=1 width=40) - -> Partition Iterator (cost=0.00..12.35 rows=2 width=40) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..12.35 rows=2 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10) AND (col2 > 0)) Selected Partitions: 1 (7 rows) @@ -2252,40 +2252,40 @@ select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 orde 1 | 60 | aaaaaaa (3 rows) -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset 3; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=12.22..24.43 rows=3 width=50) - -> LockRows (cost=0.00..24.43 rows=6 width=50) - -> Partition Iterator (cost=0.00..24.37 rows=6 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.37 rows=6 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (8 rows) -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset null; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset null; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..12.22 rows=3 width=50) - -> LockRows (cost=0.00..24.43 rows=6 width=50) - -> Partition Iterator (cost=0.00..24.37 rows=6 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.37 rows=6 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (8 rows) -explain select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 offset 3; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=12.35..12.35 rows=1 width=40) - -> Partition Iterator (cost=0.00..12.35 rows=2 width=40) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..12.35 rows=2 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10) AND (col2 > 0)) Selected Partitions: 1 (7 rows) @@ -2382,65 +2382,65 @@ select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 orde 9 | 100 | aaaaaaa (87 rows) -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update offset 3; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update offset 3; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=12.22..24.43 rows=3 width=50) - -> LockRows (cost=0.00..24.43 rows=6 width=50) - -> Partition Iterator (cost=0.00..24.37 rows=6 width=50) + Limit + -> LockRows + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.37 rows=6 width=50) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (8 rows) -explain update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Update on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=46) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=46) + Update on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=46) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 3) AND (col2 = 2)) Selected Partitions: 1 (7 rows) update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; -explain delete from test_bypass_sql_partition where col1=1 and col2=1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) delete from test_bypass_sql_partition where col1=1 and col2=1; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [Bypass] - Delete on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=10) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=10) + Delete on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=10) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 = 1) AND (col2 = 1)) Selected Partitions: 1 (7 rows) delete from test_bypass_sql_partition where col1=1 and col2=1; --error -explain delete from test_bypass_sql_partition where col1 is null and col2 is null; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) delete from test_bypass_sql_partition where col1 is null and col2 is null; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in zero partition. - Delete on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=10) - -> Partition Iterator (cost=0.00..8.27 rows=1 width=10) + Delete on test_bypass_sql_partition + -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..8.27 rows=1 width=10) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 IS NULL) AND (col2 IS NULL)) Selected Partitions: NONE (7 rows) delete from test_bypass_sql_partition where col1 is null and col2 is null; -explain insert into test_bypass_sql_partition values (null,null,null); - QUERY PLAN ------------------------------------------------------------------------ +explain (costs off) insert into test_bypass_sql_partition values (null,null,null); + QUERY PLAN +------------------------------------- [Bypass] - Insert on test_bypass_sql_partition (cost=0.00..0.01 rows=1 width=0) - -> Result (cost=0.00..0.01 rows=1 width=0) + Insert on test_bypass_sql_partition + -> Result (3 rows) insert into test_bypass_sql_partition values (null,null,null); @@ -2462,13 +2462,13 @@ select * from test_bypass_sql_partition where col1=3; 3 | 100 | aaaaaaa (11 rows) -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 desc; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 desc; + QUERY PLAN +---------------------------------------------------------------------------------------------------------- [Bypass] - Partition Iterator (cost=0.00..24.37 rows=6 width=8) + Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan Backward using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.37 rows=6 width=8) + -> Partitioned Index Only Scan Backward using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (6 rows) @@ -2477,7 +2477,7 @@ select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order b ERROR: syntax error at or near "desc" LINE 1: ...tition where col1>0 and col1<10 order by col1 limit 10 desc; ^ -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 limit 10 order by col1; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 limit 10 order by col1; ERROR: syntax error at or near "order" LINE 1: ...s_sql_partition where col1>0 and col1<10 limit 10 order by c... ^ @@ -2486,14 +2486,14 @@ ERROR: syntax error at or near "order" LINE 1: ...s_sql_partition where col1>0 and col1<10 limit 10 order by c... ^ --not bypass -explain select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..1.59 rows=10 width=8) - -> Partition Iterator (cost=0.00..185.76 rows=1167 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..185.76 rows=1167 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Selected Partitions: 1..8 (6 rows) @@ -2512,29 +2512,29 @@ select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; 0 | 90 (10 rows) -explain select * from test_bypass_sql_partition where col1 > 0 order by col1,col2 desc limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ +explain (costs off) select * from test_bypass_sql_partition where col1 > 0 order by col1,col2 desc limit 10; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Limit (cost=143.46..143.49 rows=10 width=40) - -> Sort (cost=143.46..144.44 rows=389 width=40) + Limit + -> Sort Sort Key: col1, col2 DESC - -> Partition Iterator (cost=0.00..135.06 rows=389 width=40) + -> Partition Iterator Iterations: 8 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..135.06 rows=389 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 > 0) Selected Partitions: 1..8 (9 rows) --bypass -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1,col2 limit 10 ; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1,col2 limit 10 ; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [Bypass] - Limit (cost=0.00..24.37 rows=6 width=8) - -> Partition Iterator (cost=0.00..24.37 rows=6 width=8) + Limit + -> Partition Iterator Iterations: 1 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.37 rows=6 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: ((col1 > 0) AND (col1 < 10)) Selected Partitions: 1 (7 rows) @@ -2555,24 +2555,24 @@ select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order b (10 rows) --not bypass -explain select * from test_bypass_sql_partition where true; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- +explain (costs off) select * from test_bypass_sql_partition where true; + QUERY PLAN +------------------------------------------------------------------------------------ [No Bypass]reason: Bypass not executed because query's scan operator is not index. - Partition Iterator (cost=10000000000.00..1000000002167.00 rows=1167 width=40) + Partition Iterator Iterations: 8 - -> Partitioned Seq Scan on test_bypass_sql_partition (cost=10000000000.00..1000000002167.00 rows=1167 width=40) + -> Partitioned Seq Scan on test_bypass_sql_partition Selected Partitions: 1..8 (5 rows) -explain select col1, col2 from test_bypass_sql_partition where true order by col1 limit 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) select col1, col2 from test_bypass_sql_partition where true order by col1 limit 10; + QUERY PLAN +------------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not support query in multiple partitions. - Limit (cost=0.00..1.59 rows=10 width=8) - -> Partition Iterator (cost=0.00..185.76 rows=1167 width=8) + Limit + -> Partition Iterator Iterations: 8 - -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..185.76 rows=1167 width=8) + -> Partitioned Index Only Scan using itest_bypass_sql_partition on test_bypass_sql_partition Selected Partitions: 1..8 (6 rows) @@ -2622,14 +2622,14 @@ select col1, col2 from test_bypass_sql_partition where col1>0 and col1<10 order 9 | 10 (10 rows) -explain insert into test_bypass_sql_partition select * from test_bypass_sql_partition where col1=0; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- +explain (costs off) insert into test_bypass_sql_partition select * from test_bypass_sql_partition where col1=0; + QUERY PLAN +-------------------------------------------------------------------------------------------------- [No Bypass]reason: Bypass not executed because query combines insert operator with others. - Insert on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=40) - -> Partition Iterator (cost=0.00..24.36 rows=6 width=40) + Insert on test_bypass_sql_partition + -> Partition Iterator Iterations: 1 - -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition (cost=0.00..24.36 rows=6 width=40) + -> Partitioned Index Scan using itest_bypass_sql_partition on test_bypass_sql_partition Index Cond: (col1 = 0) Selected Partitions: 1 (7 rows) diff --git a/src/test/regress/sql/bypass_simplequery_support.sql b/src/test/regress/sql/bypass_simplequery_support.sql index ada3ec28a..5daade852 100755 --- a/src/test/regress/sql/bypass_simplequery_support.sql +++ b/src/test/regress/sql/bypass_simplequery_support.sql @@ -14,167 +14,167 @@ drop table if exists test_bypass_sq1; create table test_bypass_sq1(col1 int, col2 int, col3 text); create index itest_bypass_sq1 on test_bypass_sq1(col1,col2); -- bypass insert data - explain insert into test_bypass_sq1 values (0,0,'test_insert'); + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert'); insert into test_bypass_sq1 values (0,0,'test_insert'); - explain insert into test_bypass_sq1 values (0,1,'test_insert'); + explain (costs off) insert into test_bypass_sq1 values (0,1,'test_insert'); insert into test_bypass_sq1 values (0,1,'test_insert'); - explain insert into test_bypass_sq1 values (1,1,'test_insert'); + explain (costs off) insert into test_bypass_sq1 values (1,1,'test_insert'); insert into test_bypass_sq1 values (1,1,'test_insert'); - explain insert into test_bypass_sq1 values (1,2,'test_insert'); + explain (costs off) insert into test_bypass_sq1 values (1,2,'test_insert'); insert into test_bypass_sq1 values (1,2,'test_insert'); - explain insert into test_bypass_sq1 values (0,0,'test_insert2'); + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert2'); insert into test_bypass_sq1 values (0,0,'test_insert2'); - explain insert into test_bypass_sq1 values (2,2,'test_insert2'); + explain (costs off) insert into test_bypass_sq1 values (2,2,'test_insert2'); insert into test_bypass_sq1 values (2,2,'test_insert2'); - explain insert into test_bypass_sq1 values (0,0,'test_insert3'); + explain (costs off) insert into test_bypass_sq1 values (0,0,'test_insert3'); insert into test_bypass_sq1 values (0,0,'test_insert3'); - explain insert into test_bypass_sq1 values (3,3,'test_insert3'); + explain (costs off) insert into test_bypass_sq1 values (3,3,'test_insert3'); insert into test_bypass_sq1 values (3,3,'test_insert3'); - explain insert into test_bypass_sq1(col1,col2) values (1,1); + explain (costs off) insert into test_bypass_sq1(col1,col2) values (1,1); insert into test_bypass_sq1(col1,col2) values (1,1); - explain insert into test_bypass_sq1(col1,col2) values (2,2); + explain (costs off) insert into test_bypass_sq1(col1,col2) values (2,2); insert into test_bypass_sq1(col1,col2) values (2,2); - explain insert into test_bypass_sq1(col1,col2) values (3,3); + explain (costs off) insert into test_bypass_sq1(col1,col2) values (3,3); insert into test_bypass_sq1(col1,col2) values (3,3); - explain insert into test_bypass_sq1 values (null,null,null); + explain (costs off) insert into test_bypass_sq1 values (null,null,null); insert into test_bypass_sq1 values (null,null,null); --bypass set enable_indexonlyscan=off; -explain select * from test_bypass_sq1 where col1=0 and col2=0; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0; select * from test_bypass_sq1 where col1=0 and col2=0; -explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2; select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2; -explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1; select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0; reset enable_indexonlyscan; --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1; -explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0; select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0; reset enable_indexscan; --error -explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit -1; -explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for update limit -1; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit -1; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for update limit -1; --bypass -explain update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; +explain (costs off) update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null; -explain select * from test_bypass_sq1 where col1 is null and col2 is null; +explain (costs off) select * from test_bypass_sq1 where col1 is null and col2 is null; select * from test_bypass_sq1 where col1 is null and col2 is null; -explain select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2; select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2; -explain select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; +explain (costs off) select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1; -explain update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; +explain (costs off) update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0; -explain update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; +explain (costs off) update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; update test_bypass_sq1 set col2=col1 where col1=0 and col2=0; -explain update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; +explain (costs off) update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2; -explain select * from test_bypass_sq1 where col1=0 and col2=-1; +explain (costs off) select * from test_bypass_sq1 where col1=0 and col2=-1; select * from test_bypass_sq1 where col1=0 and col2=-1; --not bypass -explain insert into test_bypass_sq1 values(0,generate_series(1,100),'test'); -explain select * from test_bypass_sq1 where col3 is not null; +explain (costs off) insert into test_bypass_sq1 values(0,generate_series(1,100),'test'); +explain (costs off) select * from test_bypass_sq1 where col3 is not null; --bypass -explain update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; +explain (costs off) update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1; --bypass / set enable_bitmapscan=off; -explain update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; +explain (costs off) update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0; -explain select * from test_bypass_sq1 where col1=0 order by col1; +explain (costs off) select * from test_bypass_sq1 where col1=0 order by col1; select * from test_bypass_sq1 where col1=0 order by col1; -explain select * from test_bypass_sq1 where col2=2 order by col1; +explain (costs off) select * from test_bypass_sq1 where col2=2 order by col1; select * from test_bypass_sq1 where col2=2 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1; select col1,col2 from test_bypass_sq1 where col1>0 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3; -explain select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; +explain (costs off) select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2; -explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col2<5 order by col1; select col1,col2 from test_bypass_sq1 where col2<5 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; -explain select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; +explain (costs off) select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; -explain select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1; +explain (costs off) select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1; select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1; --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sq1 where col1=0 order by col2; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1=0 order by col2; select col1,col2 from test_bypass_sq1 where col1=0 order by col2; -explain select col2,col1 from test_bypass_sq1 where col2=2 order by col1; +explain (costs off) select col2,col1 from test_bypass_sq1 where col2=2 order by col1; select col2,col1 from test_bypass_sq1 where col2=2 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>0 order by col1; select col1,col2 from test_bypass_sq1 where col1>0 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null; -explain select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; +explain (costs off) select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3; -explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col2<5 order by col1; select col1,col2 from test_bypass_sq1 where col2<5 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1; -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3; -explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null; select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null; reset enable_indexscan; --not bypass -explain select * from test_bypass_sq1 where col1>col2; -explain select * from test_bypass_sq1 where col1=3 and col2=3 for update; +explain (costs off) select * from test_bypass_sq1 where col1>col2; +explain (costs off) select * from test_bypass_sq1 where col1=3 and col2=3 for update; select * from test_bypass_sq1 where col1=3 and col2=3 for update; -explain select * from test_bypass_sq1 where col3='test_update2'; +explain (costs off) select * from test_bypass_sq1 where col3='test_update2'; --bypass -explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3; +explain (costs off) select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3; select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3; select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 30; -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3; -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null; -explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 30; -explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3; +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3; +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null; +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 30; +explain (costs off) select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3; select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3; select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 30; -explain select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3; -explain update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; +explain (costs off) select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3; +explain (costs off) update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2; -explain delete from test_bypass_sq1 where col1=1 and col2=1; +explain (costs off) delete from test_bypass_sq1 where col1=1 and col2=1; delete from test_bypass_sq1 where col1=1 and col2=1; -explain delete from test_bypass_sq1 where col1 is null and col2 is null; +explain (costs off) delete from test_bypass_sq1 where col1 is null and col2 is null; delete from test_bypass_sq1 where col1 is null and col2 is null; -explain insert into test_bypass_sq1 values (null,null,null); +explain (costs off) insert into test_bypass_sq1 values (null,null,null); insert into test_bypass_sq1 values (null,null,null); --bypass / set enable_bitmapscan=off; select * from test_bypass_sq1 where col1=3; -explain select col1,col2 from test_bypass_sq1 order by col1 desc; +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1 desc; select col1,col2 from test_bypass_sq1 order by col1 desc; --order by is supported when ordered col is in index -explain select col1,col2 from test_bypass_sq1 order by col1; +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1; select col1,col2 from test_bypass_sq1 order by col1; --not bypass -explain select col1,col2 from test_bypass_sq1 order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sq1 order by col1,col2; select col1,col2 from test_bypass_sq1 order by col1,col2; -explain select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc; +explain (costs off) select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc; --bypass -explain select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2; --not bypass -explain select * from test_bypass_sq1 where true; +explain (costs off) select * from test_bypass_sq1 where true; --bypass -explain select col1, col2 from test_bypass_sq1 where true order by col1; +explain (costs off) select col1, col2 from test_bypass_sq1 where true order by col1; select col1, col2 from test_bypass_sq1 where true order by col1; select col2, col1 from test_bypass_sq1 order by col1; select col1, col2 from test_bypass_sq1 order by col1 desc; -explain insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0; +explain (costs off) insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0; insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0; -- @@ -182,48 +182,48 @@ drop table if exists test_bypass_sq2; create table test_bypass_sq2(col1 int not null, col2 int); create index itest_bypass_sq2 on test_bypass_sq2(col1); --bypass -explain insert into test_bypass_sq2(col1) values (0); +explain (costs off) insert into test_bypass_sq2(col1) values (0); insert into test_bypass_sq2(col1) values (0); --error -explain insert into test_bypass_sq2(col1) values (null); +explain (costs off) insert into test_bypass_sq2(col1) values (null); --bypass -explain insert into test_bypass_sq2(col1,col2) values (1,1); +explain (costs off) insert into test_bypass_sq2(col1,col2) values (1,1); insert into test_bypass_sq2(col1,col2) values (1,1); insert into test_bypass_sq2(col1,col2) values (3,3); insert into test_bypass_sq2(col1,col2) values (-1,-1); insert into test_bypass_sq2(col1,col2) values (1,1); insert into test_bypass_sq2(col1,col2) values (2,2); insert into test_bypass_sq2(col1,col2) values (3,3); -explain insert into test_bypass_sq2(col1,col2) values (null,null);--error +explain (costs off) insert into test_bypass_sq2(col1,col2) values (null,null);--error --bypass set enable_indexonlyscan=off; -explain update test_bypass_sq2 set col2 = col2+1 where col1 = 0; +explain (costs off) update test_bypass_sq2 set col2 = col2+1 where col1 = 0; update test_bypass_sq2 set col2 = col2+1 where col1 = 0; -explain select * from test_bypass_sq2 where col1 = 0 order by col1; +explain (costs off) select * from test_bypass_sq2 where col1 = 0 order by col1; select * from test_bypass_sq2 where col1 = 0 order by col1; -explain select * from test_bypass_sq2 where col1 >= 0 order by col1; +explain (costs off) select * from test_bypass_sq2 where col1 >= 0 order by col1; select * from test_bypass_sq2 where col1 >= 0 order by col1; -explain select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; +explain (costs off) select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4; -explain select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; +explain (costs off) select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1; -explain select col1 from test_bypass_sq2 order by col1 limit 2; +explain (costs off) select col1 from test_bypass_sq2 order by col1 limit 2; select col1 from test_bypass_sq2 order by col1 limit 2; -explain select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; +explain (costs off) select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2; -explain select * from test_bypass_sq2 where col1 > 0 order by col1 for update limit 2 offset 2; +explain (costs off) select * from test_bypass_sq2 where col1 > 0 order by col1 for update limit 2 offset 2; reset enable_indexonlyscan; --not bypass -explain select * from test_bypass_sq2 where col2 is null; -explain select * from test_bypass_sq2 where col1 = 0 and col2 = 0; -explain select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1; -explain select count(*),col1 from test_bypass_sq1 group by col1; +explain (costs off) select * from test_bypass_sq2 where col2 is null; +explain (costs off) select * from test_bypass_sq2 where col1 = 0 and col2 = 0; +explain (costs off) select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1; +explain (costs off) select count(*),col1 from test_bypass_sq1 group by col1; --bypass (order by is supported when ordered col is in index) select col1 from test_bypass_sq2 order by col1 desc; select col1 from test_bypass_sq2 order by col1; --not bypass -explain select * from test_bypass_sq2 order by col1,col2; +explain (costs off) select * from test_bypass_sq2 order by col1,col2; -- drop table if exists test_bypass_sq3; create table test_bypass_sq3(col1 int default 1, col2 int, col3 timestamp); @@ -235,8 +235,8 @@ insert into test_bypass_sq3(col2,col3) values(1,default); insert into test_bypass_sq3 values(2,3,null); insert into test_bypass_sq3 values (3,3,null); --not bypass -explain insert into test_bypass_sq3 values(3,3,current_timestamp); -explain select * from test_bypass_sq3 where col1 = 1 order by col2; +explain (costs off) insert into test_bypass_sq3 values(3,3,current_timestamp); +explain (costs off) select * from test_bypass_sq3 where col1 = 1 order by col2; --bypass select * from test_bypass_sq3 where col1 = 1 limit 1; select col2 from test_bypass_sq3 where col1 = 1 for update; @@ -261,19 +261,19 @@ insert into test_bypass_sq4 values (55,55,null); insert into test_bypass_sq4 values (55,null,55); insert into test_bypass_sq4 values (55,null,null); insert into test_bypass_sq4 values (null,null,null); -explain select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; +explain (costs off) select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3; -explain select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; +explain (costs off) select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2; -explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2; +explain (costs off) select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2; select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2; select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2; -explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update; -explain select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update; +explain (costs off) select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update; +explain (costs off) select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update; select col2,col3,col2 from test_bypass_sq4 where col3 is null and col2 is null order by col3,col2; -explain select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; +explain (costs off) select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null; -explain select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc; +explain (costs off) select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc; select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc; drop table if exists test_bypass_sq5; @@ -351,7 +351,7 @@ create type complextype AS (f1 int, f2 text); create table test_bypass_sq6(col1 int, col2 complextype,col3 text); create index itest_bypass_sq6 on test_bypass_sq6(col1,col3); --not bypass -explain insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text); +explain (costs off) insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text); -- just insert reset opfusion_debug_mode; insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text); @@ -365,7 +365,7 @@ select col1 from test_bypass_sq6; select col3 from test_bypass_sq6 order by col1,col3; select col1, col3 from test_bypass_sq6 where true; --notbypass -explain update test_bypass_sq6 set col2=ROW(2,'Ruby2'::text) where col1 = 1; +explain (costs off) update test_bypass_sq6 set col2=ROW(2,'Ruby2'::text) where col1 = 1; --bypass delete from test_bypass_sq6 where col1 = 1; --test QPS @@ -403,10 +403,10 @@ create table test_bypass_sq8(col1 int, col2 int, col3 text); create index itest_bypass_sq8 on test_bypass_sq8(col1,col2); create trigger tri_bypass after insert on test_bypass_sq8 for each row execute procedure tri_bypass(); insert into test_bypass_sq8 values(1,1,'test'); -explain select * from test_bypass_sq8 where col1 = 1; -explain update test_bypass_sq8 set col2 = 2 where col1 = 1; -explain delete test_bypass_sq8 where col1 = 1; -explain insert into test_bypass_sq8 values(2,2,'testinsert'); +explain (costs off) select * from test_bypass_sq8 where col1 = 1; +explain (costs off) update test_bypass_sq8 set col2 = 2 where col1 = 1; +explain (costs off) delete test_bypass_sq8 where col1 = 1; +explain (costs off) insert into test_bypass_sq8 values(2,2,'testinsert'); set opfusion_debug_mode=off; RESET SESSION AUTHORIZATION; SELECT node_name,select_count, update_count, insert_count, delete_count, ddl_count, dml_count FROM pgxc_sql_count where user_name='qps' order by node_name; @@ -425,7 +425,7 @@ CREATE OR REPLACE RULE v_delete as ON DELETE TO v_test DO INSTEAD NOTHING; delete from v_test; set explain_perf_mode=pretty; -explain delete from v_test; +explain (costs off) delete from v_test; reset explain_perf_mode; drop table test cascade; diff --git a/src/test/regress/sql/force_vector_engine2.sql b/src/test/regress/sql/force_vector_engine2.sql index d288767d7..e2ab5c32b 100644 --- a/src/test/regress/sql/force_vector_engine2.sql +++ b/src/test/regress/sql/force_vector_engine2.sql @@ -15,8 +15,8 @@ partition by range(id) ( insert into force_vector_partition values(generate_series(1, 10000), generate_series(1, 2000), generate_series(1, 5000)); analyze force_vector_partition; -explain (analyze on, timing off) select /*+ set(try_vector_engine_strategy force) */ id, val1*2, val2+val1 as val3 from force_vector_test where id < 5000 and val1 < 500 order by id limit 10; -explain (analyze on, timing off) select /*+ set(try_vector_engine_strategy force) */ id, avg(val1), sum(val2) from force_vector_partition group by id order by id limit 10; +explain (analyze on, timing off, costs off) select /*+ set(try_vector_engine_strategy force) */ id, val1*2, val2+val1 as val3 from force_vector_test where id < 5000 and val1 < 500 order by id limit 10; +explain (analyze on, timing off, costs off) select /*+ set(try_vector_engine_strategy force) */ id, avg(val1), sum(val2) from force_vector_partition group by id order by id limit 10; drop table force_vector_test; drop schema test_force_vector2 cascade; diff --git a/src/test/regress/sql/sqlbypass_partition.sql b/src/test/regress/sql/sqlbypass_partition.sql index cfbafc6e6..767e2424c 100755 --- a/src/test/regress/sql/sqlbypass_partition.sql +++ b/src/test/regress/sql/sqlbypass_partition.sql @@ -22,33 +22,33 @@ partition test_bypass_sql_partition_8 values less than(80) ); create index itest_bypass_sql_partition on test_bypass_sql_partition(col1,col2) local; --insert -explain insert into test_bypass_sql_partition values (0,0,'test_insert'); +explain (costs off) insert into test_bypass_sql_partition values (0,0,'test_insert'); insert into test_bypass_sql_partition values (0,0,'test_insert'); -explain insert into test_bypass_sql_partition values (0,1,'test_insert'); +explain (costs off) insert into test_bypass_sql_partition values (0,1,'test_insert'); insert into test_bypass_sql_partition values (0,1,'test_insert'); -explain insert into test_bypass_sql_partition values (11,1,'test_insert'); +explain (costs off) insert into test_bypass_sql_partition values (11,1,'test_insert'); insert into test_bypass_sql_partition values (11,1,'test_insert'); -explain insert into test_bypass_sql_partition values (11,2,'test_insert'); +explain (costs off) insert into test_bypass_sql_partition values (11,2,'test_insert'); insert into test_bypass_sql_partition values (11,2,'test_insert'); -explain insert into test_bypass_sql_partition values (0,10,'test_insert2'); +explain (costs off) insert into test_bypass_sql_partition values (0,10,'test_insert2'); insert into test_bypass_sql_partition values (0,10,'test_insert2'); -explain insert into test_bypass_sql_partition values (2,12,'test_insert2'); +explain (costs off) insert into test_bypass_sql_partition values (2,12,'test_insert2'); insert into test_bypass_sql_partition values (2,12,'test_insert2'); -explain insert into test_bypass_sql_partition values (30,0,'test_insert3'); +explain (costs off) insert into test_bypass_sql_partition values (30,0,'test_insert3'); insert into test_bypass_sql_partition values (30,0,'test_insert3'); -explain insert into test_bypass_sql_partition values (3,3,'test_insert3'); +explain (costs off) insert into test_bypass_sql_partition values (3,3,'test_insert3'); insert into test_bypass_sql_partition values (3,3,'test_insert3'); -explain insert into test_bypass_sql_partition(col1,col2) values (1,1); +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (1,1); insert into test_bypass_sql_partition(col1,col2) values (1,1); -explain insert into test_bypass_sql_partition(col1,col2) values (22,2); +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (22,2); insert into test_bypass_sql_partition(col1,col2) values (22,2); -explain insert into test_bypass_sql_partition(col1,col2) values (33,3); +explain (costs off) insert into test_bypass_sql_partition(col1,col2) values (33,3); insert into test_bypass_sql_partition(col1,col2) values (33,3); --error -explain insert into test_bypass_sql_partition values (null,null,null); +explain (costs off) insert into test_bypass_sql_partition values (null,null,null); insert into test_bypass_sql_partition values (null,null,null); --nobypass -explain insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); +explain (costs off) insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); --select drop table if exists test_bypass_sql_partition; @@ -68,90 +68,90 @@ create index itest_bypass_sql_partition on test_bypass_sql_partition(col1,col2) insert into test_bypass_sql_partition select generate_series(0,79,1), generate_series(0,100,10), repeat('a',7); --bypass set enable_indexonlyscan=off; -explain select * from test_bypass_sql_partition where col1=0 and col2=0; +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0; select * from test_bypass_sql_partition where col1=0 and col2=0; -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 and col2 <= 20 order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 and col2 <= 20 order by col1,col2; select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 and col2 <= 20 order by col1,col2; -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 1; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 1; select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 1; -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 for update limit 1; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 for update limit 1; select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 for update limit 1; -explain select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 0; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 0; select col1,col2 from test_bypass_sql_partition where col1>10 and col1<20 and col2>0 order by col1,col2 limit 0; -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order by col1,col2 for update limit 0; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order by col1,col2 for update limit 0; select col1,col2 from test_bypass_sql_partition where col1=10 and col2=0 order by col1,col2 for update limit 0; -explain select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 is not null order by col1,col2; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 is not null order by col1,col2; select col1,col2 from test_bypass_sql_partition where col1 is not null and col2 is not null order by col1,col2; -explain select * from test_bypass_sql_partition where col1 is not null and col2 = 0 order by col1; +explain (costs off) select * from test_bypass_sql_partition where col1 is not null and col2 = 0 order by col1; select * from test_bypass_sql_partition where col1 is not null and col2 = 0 order by col1; -explain select * from test_bypass_sql_partition where col1=0 and col2=-1; +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=-1; select * from test_bypass_sql_partition where col1=0 and col2=-1; reset enable_indexonlyscan; --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10; -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 1; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 1; select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 1; -explain select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 0; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 0; select col1,col2 from test_bypass_sql_partition where col1=10 and col2=10 order by col1 limit 0; reset enable_indexscan; --error -explain select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 limit -1; -explain select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; +explain (costs off) select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; select * from test_bypass_sql_partition where col1=0 and col2=0 order by col1 for update limit -1; --nobypass -explain select * from test_bypass_sql_partition where col1 is null and col2 is null; +explain (costs off) select * from test_bypass_sql_partition where col1 is null and col2 is null; select * from test_bypass_sql_partition where col1 is null and col2 is null; select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 order by col1 limit 10; -explain select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 order by col1 limit 10; +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 <= 30 and col1 >= 10 order by col1 limit 10; select col1, col2 from test_bypass_sql_partition order by col1 limit 10; -explain select col1, col2 from test_bypass_sql_partition order by col1 limit 10; +explain (costs off) select col1, col2 from test_bypass_sql_partition order by col1 limit 10; select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 limit 10; -explain select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 limit 10; +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 > 0 order by col1 limit 10; select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 limit 10; -explain select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 limit 10; +explain (costs off) select col1, col2 from test_bypass_sql_partition where col1 < 20 order by col1 limit 10; --update --bypass -explain update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=0 and col2=0; +explain (costs off) update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=0 and col2=0; update test_bypass_sql_partition set col2=col2-1,col3='test_update' where col1=10 and col2=0; -explain update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; +explain (costs off) update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; update test_bypass_sql_partition set col2=col1-1,col3='test_update' where col1=20 and col2=2; -explain update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; +explain (costs off) update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; update test_bypass_sql_partition set col2=mod(5,3) where col1=1 and col2=10; --not bypass -explain insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); -explain select * from test_bypass_sql_partition where col3 is not null; -explain update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; +explain (costs off) insert into test_bypass_sql_partition values(0,generate_series(1,100),'test'); +explain (costs off) select * from test_bypass_sql_partition where col3 is not null; +explain (costs off) update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; update test_bypass_sql_partition set col3='test_null' where col1 is null and col2 is null; --bypass -explain update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; +explain (costs off) update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; update test_bypass_sql_partition set col2=111,col3='test_update2' where col1=0; -explain select * from test_bypass_sql_partition where col1=0 order by col1; +explain (costs off) select * from test_bypass_sql_partition where col1=0 order by col1; select * from test_bypass_sql_partition where col1=0 order by col1; -explain select * from test_bypass_sql_partition where col1=0 order by col1 for update limit 2; +explain (costs off) select * from test_bypass_sql_partition where col1=0 order by col1 for update limit 2; select * from test_bypass_sql_partition where col1=0 order by col1 for update limit 2; -explain select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 for update limit 1; +explain (costs off) select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 for update limit 1; select * from test_bypass_sql_partition where col1=1 and col2=20 order by col1 for update limit 1; --nobypass -explain select * from test_bypass_sql_partition where col2=20 order by col1; +explain (costs off) select * from test_bypass_sql_partition where col2=20 order by col1; select * from test_bypass_sql_partition where col2=20 order by col1; -explain select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 10; -explain select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 3; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 3; select col1,col2 from test_bypass_sql_partition where col1>0 order by col1 limit 3; -explain select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col2<50 order by col1 limit 10; -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 10; -explain select * from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 3; +explain (costs off) select * from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 3; select * from test_bypass_sql_partition where col1>=0 and col2>0 order by col1 limit 3; @@ -173,74 +173,74 @@ insert into test_bypass_sql_partition select generate_series(0,79,1), generate_s --bypass though index only scan set enable_indexscan = off; -explain select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; select col1,col2 from test_bypass_sql_partition where col1=0 order by col2; -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; -explain select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 3; +explain (costs off) select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 3; select col2,col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 3; -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit 3; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit 3; select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit 3; -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit null; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit null; select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<10 and col2>0 order by col1 limit null; --nobypass -explain select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit 10; +explain (costs off) select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit 10; select col2,col1 from test_bypass_sql_partition where col2=2 order by col1 limit 10; -explain select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is null limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is null limit 10; select col1,col2 from test_bypass_sql_partition where col1 is null and col2 is null limit 10; -explain select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col2<5 order by col1 limit 10; -explain select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and col2>0 order by col1 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and col2>0 order by col1 limit 10; select col1,col2 from test_bypass_sql_partition where col1>=0 and col1<=10 and col2>0 order by col1 limit 10; reset enable_indexscan; --nobypass -explain select * from test_bypass_sql_partition where col1>col2 limit 10; -explain select * from test_bypass_sql_partition where col1=3 and col2=3 for update; +explain (costs off) select * from test_bypass_sql_partition where col1>col2 limit 10; +explain (costs off) select * from test_bypass_sql_partition where col1=3 and col2=3 for update; select * from test_bypass_sql_partition where col1=3 and col2=3 for update; -explain select * from test_bypass_sql_partition where col3='test_update2'; +explain (costs off) select * from test_bypass_sql_partition where col3='test_update2'; -explain select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 limit 3 offset 3; +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 limit 3 offset 3; select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 limit 3 offset 3; -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset 3; -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset null; -explain select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 offset 3; +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset 3; +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update limit 3 offset null; +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 offset 3; select * from test_bypass_sql_partition where col1>0 and col1<10 and col2>0 order by col1 offset 3; -explain select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update offset 3; -explain update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; +explain (costs off) select * from test_bypass_sql_partition where col1>0 and col1<10 order by col1 for update offset 3; +explain (costs off) update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; update test_bypass_sql_partition set col2=3*7 where col1=3 and col2=2; -explain delete from test_bypass_sql_partition where col1=1 and col2=1; +explain (costs off) delete from test_bypass_sql_partition where col1=1 and col2=1; delete from test_bypass_sql_partition where col1=1 and col2=1; --error -explain delete from test_bypass_sql_partition where col1 is null and col2 is null; +explain (costs off) delete from test_bypass_sql_partition where col1 is null and col2 is null; delete from test_bypass_sql_partition where col1 is null and col2 is null; -explain insert into test_bypass_sql_partition values (null,null,null); +explain (costs off) insert into test_bypass_sql_partition values (null,null,null); insert into test_bypass_sql_partition values (null,null,null); --bypass / set enable_bitmapscan=off; select * from test_bypass_sql_partition where col1=3; -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 desc; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 desc; select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10 desc; --order by is supported when ordered col is in index -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 limit 10 order by col1; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 limit 10 order by col1; select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 limit 10 order by col1; --not bypass -explain select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; +explain (costs off) select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; select col1,col2 from test_bypass_sql_partition order by col1,col2 limit 10; -explain select * from test_bypass_sql_partition where col1 > 0 order by col1,col2 desc limit 10; +explain (costs off) select * from test_bypass_sql_partition where col1 > 0 order by col1,col2 desc limit 10; --bypass -explain select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1,col2 limit 10 ; +explain (costs off) select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1,col2 limit 10 ; select col1,col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1,col2 limit 10; --not bypass -explain select * from test_bypass_sql_partition where true; -explain select col1, col2 from test_bypass_sql_partition where true order by col1 limit 10; +explain (costs off) select * from test_bypass_sql_partition where true; +explain (costs off) select col1, col2 from test_bypass_sql_partition where true order by col1 limit 10; select col1, col2 from test_bypass_sql_partition where true order by col1 limit 10; --bypass select col2, col1 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 limit 10; select col1, col2 from test_bypass_sql_partition where col1>0 and col1<10 order by col1 desc limit 10; -explain insert into test_bypass_sql_partition select * from test_bypass_sql_partition where col1=0; +explain (costs off) insert into test_bypass_sql_partition select * from test_bypass_sql_partition where col1=0; delete from test_bypass_sql_partition where col1=1; delete from test_bypass_sql_partition where col1 > 10 and col1 < 0;