!437 fix the display of bypass while explain simplequery

Merge pull request !437 from mujinqiang/master
This commit is contained in:
opengauss-bot
2020-12-14 11:41:21 +08:00
committed by Gitee
10 changed files with 208 additions and 176 deletions

View File

@ -614,7 +614,7 @@ static void ExplainOneQuery(
}
u_sess->exec_cxt.remotequery_list = NIL;
es->is_explain_gplan = false;
es->is_explain_gplan = true;
/* planner will not cope with utility statements */
if (query->commandType == CMD_UTILITY) {
if (IsA(query->utilityStmt, CreateTableAsStmt)) {

View File

@ -15,108 +15,108 @@ 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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
insert into test_bypass_sq1(col1,col2) values (3,3);
explain insert into test_bypass_sq1 values (null,null,null);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -127,7 +127,7 @@ set enable_indexonlyscan=off;
explain select * from test_bypass_sq1 where col1=0 and col2=0;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40)
Index Cond: ((col1 = 0) AND (col2 = 0))
(3 rows)
@ -143,7 +143,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=8)
Index Cond: ((col1 > 0) AND (col2 > 0))
(3 rows)
@ -163,7 +163,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 > 0) AND (col2 > 0))
@ -178,7 +178,7 @@ 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 for update limit 1;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -194,7 +194,7 @@ 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 0;
QUERY PLAN
----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 0) AND (col2 = 0))
@ -208,7 +208,7 @@ 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 for update limit 0;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -226,7 +226,7 @@ set enable_indexscan = off;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8)
Index Cond: ((col1 = 0) AND (col2 = 0))
(3 rows)
@ -242,7 +242,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 0) AND (col2 = 0))
@ -257,7 +257,7 @@ select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limi
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 0) AND (col2 = 0))
@ -271,18 +271,18 @@ 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;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
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;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
@ -293,7 +293,7 @@ explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for
explain update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 IS NULL) AND (col2 IS NULL))
@ -303,7 +303,7 @@ 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
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40)
Index Cond: ((col1 IS NULL) AND (col2 IS NULL))
(3 rows)
@ -317,7 +317,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..71.41 rows=1155 width=8)
Index Cond: ((col1 IS NOT NULL) AND (col2 IS NOT NULL))
(3 rows)
@ -341,7 +341,7 @@ select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not nul
explain select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1;
QUERY PLAN
------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..39.92 rows=6 width=40)
Index Cond: ((col1 IS NOT NULL) AND (col2 = 0))
(3 rows)
@ -357,7 +357,7 @@ 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;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[No Bypass]reason: Bypass not executed because the expression of query is not support.
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)
Index Cond: ((col1 = 0) AND (col2 = 0))
@ -367,7 +367,7 @@ update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=
explain update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[No Bypass]reason: Bypass not executed because the expression of query is not support.
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)
Index Cond: ((col1 = 2) AND (col2 = 2))
@ -377,7 +377,7 @@ update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=
explain select * from test_bypass_sq1 where col1=0 and col2=-1;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..8.27 rows=1 width=40)
Index Cond: ((col1 = 0) AND (col2 = (-1)))
(3 rows)
@ -392,9 +392,9 @@ 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');
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -402,7 +402,7 @@ explain insert into test_bypass_sq1 values(0,generate_series(1,100),'test');
explain select * from test_bypass_sq1 where col3 is not null;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Filter: (col3 IS NOT NULL)
(3 rows)
@ -411,7 +411,7 @@ explain select * from test_bypass_sq1 where col3 is not null;
explain update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 1) AND (col2 = 1))
@ -422,7 +422,7 @@ update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1;
explain update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 = 0)
@ -432,7 +432,7 @@ 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
------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..24.36 rows=6 width=40)
Index Cond: (col1 = 0)
(3 rows)
@ -449,7 +449,7 @@ select * from test_bypass_sq1 where col1=0 order by col1;
explain select * from test_bypass_sq1 where col2=2 order by col1;
QUERY PLAN
------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..37.06 rows=6 width=40)
Index Cond: (col2 = 2)
(3 rows)
@ -465,7 +465,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=8)
Index Cond: (col1 > 0)
(3 rows)
@ -485,7 +485,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 > 0)
@ -502,7 +502,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -519,7 +519,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..60.89 rows=389 width=8)
Index Cond: (col2 < 5)
(3 rows)
@ -539,7 +539,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..49.44 rows=130 width=8)
Index Cond: ((col1 >= 0) AND (col2 > 0))
(3 rows)
@ -563,7 +563,7 @@ 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;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 >= 0) AND (col2 > 0))
@ -580,7 +580,7 @@ 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;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -598,7 +598,7 @@ set enable_indexscan = off;
explain select col1,col2 from test_bypass_sq1 where col1=0 order by col2;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000002435.51 rows=6 width=8)
Index Cond: (col1 = 0)
(3 rows)
@ -615,7 +615,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000003706.26 rows=6 width=8)
Index Cond: (col2 = 2)
(3 rows)
@ -631,7 +631,7 @@ 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;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000005105.76 rows=389 width=8)
Index Cond: (col1 > 0)
(3 rows)
@ -651,7 +651,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000000827.01 rows=1 width=8)
Index Cond: ((col1 IS NULL) AND (col2 IS NULL))
(3 rows)
@ -665,7 +665,7 @@ 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;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 > 0)
@ -682,7 +682,7 @@ 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;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000006089.26 rows=389 width=8)
Index Cond: (col2 < 5)
(3 rows)
@ -702,7 +702,7 @@ 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;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=10000000000.00..1000000004944.01 rows=130 width=8)
Index Cond: ((col1 >= 0) AND (col2 > 0))
(3 rows)
@ -726,7 +726,7 @@ 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;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 >= 0) AND (col2 > 0))
@ -743,7 +743,7 @@ select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 lim
explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 >= 0) AND (col2 > 0))
@ -770,7 +770,7 @@ reset enable_indexscan;
explain select * from test_bypass_sq1 where col1>col2;
QUERY PLAN
----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Filter: (col1 > col2)
(3 rows)
@ -778,7 +778,7 @@ explain select * from test_bypass_sq1 where col1>col2;
explain select * from test_bypass_sq1 where col1=3 and col2=3 for update;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 3) AND (col2 = 3))
@ -794,7 +794,7 @@ select * from test_bypass_sq1 where col1=3 and col2=3 for update;
explain select * from test_bypass_sq1 where col3='test_update2';
QUERY PLAN
--------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Filter: (col3 = 'test_update2'::text)
(3 rows)
@ -803,7 +803,7 @@ explain select * from test_bypass_sq1 where col3='test_update2';
explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 > 0) AND (col2 > 0))
@ -820,7 +820,7 @@ select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offs
explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -830,7 +830,7 @@ explain select * from test_bypass_sq1 where col1>0 order by col1 for update lim
explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -840,7 +840,7 @@ explain select * from test_bypass_sq1 where col1>0 order by col1 for update lim
explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 > 0) AND (col2 > 0))
@ -858,7 +858,7 @@ select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3;
explain select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -868,7 +868,7 @@ explain select * from test_bypass_sq1 where col1>0 order by col1 for update offs
explain update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 3) AND (col2 = 2))
@ -878,7 +878,7 @@ 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
----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 = 1) AND (col2 = 1))
@ -888,7 +888,7 @@ 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
----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col1 IS NULL) AND (col2 IS NULL))
@ -896,9 +896,9 @@ explain 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);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -915,7 +915,7 @@ select * from test_bypass_sq1 where col1=3;
explain select col1,col2 from test_bypass_sq1 order by col1 desc;
QUERY PLAN
----------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan Backward using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8)
(2 rows)
@ -939,7 +939,7 @@ select col1,col2 from test_bypass_sq1 order by col1 desc; --order by is supporte
explain select col1,col2 from test_bypass_sq1 order by col1;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8)
(2 rows)
@ -964,7 +964,7 @@ select col1,col2 from test_bypass_sq1 order by col1;
explain select col1,col2 from test_bypass_sq1 order by col1,col2;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8)
(2 rows)
@ -988,7 +988,7 @@ 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;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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 Key: col1, col2 DESC
-> Index Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=40)
@ -999,7 +999,7 @@ explain select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc;
explain select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..51.06 rows=389 width=8)
Index Cond: (col1 > 0)
(3 rows)
@ -1020,7 +1020,7 @@ select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2;
explain select * from test_bypass_sq1 where true;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
(2 rows)
@ -1028,7 +1028,7 @@ explain select * from test_bypass_sq1 where true;
explain select col1, col2 from test_bypass_sq1 where true order by col1;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=8)
(2 rows)
@ -1086,7 +1086,7 @@ 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;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 > 0)
@ -1100,9 +1100,9 @@ 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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -1110,18 +1110,18 @@ explain 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);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
--bypass
explain insert into test_bypass_sq2(col1,col2) values (1,1);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -1133,9 +1133,9 @@ 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
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -1145,7 +1145,7 @@ set enable_indexonlyscan=off;
explain update test_bypass_sq2 set col2 = col2+1 where col1 = 0;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[No Bypass]reason: Bypass not executed because the expression of query is not support.
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)
Index Cond: (col1 = 0)
@ -1155,7 +1155,7 @@ 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
------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..36.44 rows=11 width=8)
Index Cond: (col1 = 0)
(3 rows)
@ -1169,7 +1169,7 @@ select * from test_bypass_sq2 where col1 = 0 order by col1;
explain select * from test_bypass_sq2 where col1 >= 0 order by col1;
QUERY PLAN
-------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq2 on test_bypass_sq2 (cost=0.00..56.78 rows=716 width=8)
Index Cond: (col1 >= 0)
(3 rows)
@ -1188,7 +1188,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 >= 0)
@ -1206,7 +1206,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -1222,7 +1222,7 @@ 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;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
(3 rows)
@ -1237,7 +1237,7 @@ 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;
QUERY PLAN
-------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: (col1 > 0)
@ -1253,7 +1253,7 @@ 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;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
@ -1265,7 +1265,7 @@ reset enable_indexonlyscan;
explain select * from test_bypass_sq2 where col2 is null;
QUERY PLAN
--------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Filter: (col2 IS NULL)
(3 rows)
@ -1273,7 +1273,7 @@ explain select * from test_bypass_sq2 where col2 is null;
explain select * from test_bypass_sq2 where col1 = 0 and col2 = 0;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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 Cond: (col1 = 0)
Filter: (col2 = 0)
@ -1282,7 +1282,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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 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)
@ -1293,7 +1293,7 @@ explain select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2
explain select count(*),col1 from test_bypass_sq1 group by col1;
QUERY PLAN
-------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Group By Key: col1
-> Index Only Scan using itest_bypass_sq1 on test_bypass_sq1 (cost=0.00..65.76 rows=1167 width=4)
@ -1328,7 +1328,7 @@ select col1 from test_bypass_sq2 order by col1;
explain select * from test_bypass_sq2 order by col1,col2;
QUERY PLAN
----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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 Key: col1, col2
-> Seq Scan on test_bypass_sq2 (cost=10000000000.00..1000000003149.00 rows=2149 width=8)
@ -1347,9 +1347,9 @@ 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);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)
@ -1357,7 +1357,7 @@ explain insert into test_bypass_sq3 values(3,3,current_timestamp);
explain select * from test_bypass_sq3 where col1 = 1 order by col2;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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 Key: col2
-> Index Scan using itest_bypass_sq3 on test_bypass_sq3 (cost=0.00..32.41 rows=9 width=16)
@ -1402,7 +1402,7 @@ 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
--------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..69.32 rows=648 width=12)
Index Cond: (col2 > 22)
(3 rows)
@ -1423,7 +1423,7 @@ 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;
QUERY PLAN
-----------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..8.27 rows=1 width=12)
Index Cond: ((col3 = 32) AND (col2 = 22))
(3 rows)
@ -1437,7 +1437,7 @@ 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;
QUERY PLAN
------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..52.89 rows=216 width=8)
Index Cond: ((col3 >= 33) AND (col2 >= 22))
(3 rows)
@ -1465,7 +1465,7 @@ select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order
explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col3 >= 33) AND (col2 >= 22))
@ -1474,7 +1474,7 @@ explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >=
explain select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update;
QUERY PLAN
--------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom 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)
Index Cond: ((col3 >= 34) AND (col2 >= 22))
@ -1490,7 +1490,7 @@ select col2,col3,col2 from test_bypass_sq4 where col3 is null and col2 is null o
explain select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null;
QUERY PLAN
-----------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..32.45 rows=10 width=8)
Index Cond: ((col3 IS NULL) AND (col2 IS NOT NULL))
(3 rows)
@ -1504,7 +1504,7 @@ 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;
QUERY PLAN
----------------------------------------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
[Bypass]
Index Only Scan Backward using itest_bypass_sq4 on test_bypass_sq4 (cost=0.00..82.11 rows=1935 width=8)
Index Cond: (col3 IS NOT NULL)
(3 rows)
@ -1709,9 +1709,9 @@ 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);
QUERY PLAN
-------------------------------------------------------------------------
[No Bypass]reason: Bypass not executed because the plan is custom plan.
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)
(3 rows)

View File

@ -619,9 +619,10 @@ EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF)
SELECT * FROM point_tbl WHERE f1 IS NULL;
QUERY PLAN
-----------------------------------------
[Bypass]
Index Scan using gpointind on point_tbl
Index Cond: (f1 IS NULL)
(2 rows)
(3 rows)
SELECT * FROM point_tbl WHERE f1 IS NULL;
f1

View File

@ -406,30 +406,34 @@ analyze gt1;
explain (costs off) select * from gt1 where a=1;
QUERY PLAN
----------------------------------------
[Bypass]
Index Only Scan using idx_gt1_1 on gt1
Index Cond: (a = 1)
(2 rows)
(3 rows)
explain (costs off) select * from gt1 where a=200000;
QUERY PLAN
----------------------------------------
[Bypass]
Index Only Scan using idx_gt1_1 on gt1
Index Cond: (a = 200000)
(2 rows)
(3 rows)
explain (costs off) select * from gt1 where a*10=300;
QUERY PLAN
-----------------------------------
[Bypass]
Index Scan using idx_gt1_3 on gt1
Index Cond: ((a * 10) = 300)
(2 rows)
(3 rows)
explain (costs off) select * from gt1 where a*10=3;
QUERY PLAN
-----------------------------------
[Bypass]
Index Scan using idx_gt1_3 on gt1
Index Cond: ((a * 10) = 3)
(2 rows)
(3 rows)
--ok
create global temp table gtt_test0(c1 int) with(on_commit_delete_rows='true');

View File

@ -237,9 +237,10 @@ analyze gtt3;
explain (COSTS FALSE) select * from gtt3 where a =300;
QUERY PLAN
------------------------------------
[Bypass]
Index Scan using gtt3_pkey on gtt3
Index Cond: (a = 300)
(2 rows)
(3 rows)
insert into gtt_t_kenyon select generate_series(1,2000),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God',500);
insert into gtt_t_kenyon select generate_series(1,2),repeat('kenyon here'||'^_^',2),repeat('^_^ Kenyon is not God,Remark here!!',2000);

View File

@ -36,9 +36,10 @@ explain select * from hw_light_cn_t1 where id1 = 3 for update;
explain insert into hw_light_cn_t1 values (6,6,6);
QUERY PLAN
------------------------------------------------------------
[Bypass]
--? Insert on hw_light_cn_t1 (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
(2 rows)
(3 rows)
explain update hw_light_cn_t1 set num = 0 where id1 = 1;
QUERY PLAN
@ -349,9 +350,10 @@ c_varchar2 varchar2(10)
explain insert into testtd values('a','a','a','a');
QUERY PLAN
----------------------------------------------------
[Bypass]
--? Insert on testtd (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
(2 rows)
(3 rows)
insert into testtd values('a','a','a','a');
drop table testtd;
@ -521,10 +523,11 @@ create table tnull (id int, num int);
explain verbose insert into tnull values (null,1);
QUERY PLAN
----------------------------------------------------------
[Bypass]
--? Insert on public.tnull (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
Output: NULL::integer, 1
(3 rows)
(4 rows)
insert into tnull values (null,1);
explain verbose select * from tnull where id is null;
@ -561,26 +564,29 @@ create table tnull2 (id1 int, id2 int, num int);
explain verbose insert into tnull2 values (null,null,1);
QUERY PLAN
-----------------------------------------------------------
[Bypass]
--? Insert on public.tnull2 (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
Output: NULL::integer, NULL::integer, 1
(3 rows)
(4 rows)
explain verbose insert into tnull2 values (null,1,1);
QUERY PLAN
-----------------------------------------------------------
[Bypass]
--? Insert on public.tnull2 (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
Output: NULL::integer, 1, 1
(3 rows)
(4 rows)
explain verbose insert into tnull2 values (null,20,1);
QUERY PLAN
-----------------------------------------------------------
[Bypass]
--? Insert on public.tnull2 (cost=.* rows=.* width=.*)
--? -> Result (cost=.* rows=.* width=.*)
Output: NULL::integer, 20, 1
(3 rows)
(4 rows)
insert into tnull2 values (null,null,1);
insert into tnull2 values (null,1,1);

View File

@ -1775,30 +1775,34 @@ WARNING: unused hint: IndexOnlyScan(hint_t1 hintt1_index)
explain (costs off) select a from hint_t1 where a = 10;
QUERY PLAN
-----------------------------------------------
[Bypass]
Index Only Scan using hintt2_index on hint_t1
Index Cond: (a = 10)
(2 rows)
(3 rows)
explain (costs off) select /*+ indexonlyscan(hint_t1)*/ a from hint_t1 where a = 10;
QUERY PLAN
-----------------------------------------------
[Bypass]
Index Only Scan using hintt2_index on hint_t1
Index Cond: (a = 10)
(2 rows)
(3 rows)
explain (costs off) select /*+ indexonlyscan(hint_t1 hintt1_index)*/ a from hint_t1 where a = 10;
QUERY PLAN
-----------------------------------------------
[Bypass]
Index Only Scan using hintt1_index on hint_t1
Index Cond: (a = 10)
(2 rows)
(3 rows)
explain (costs off) select /*+ indexonlyscan(hint_t1 hintt2_index)*/ a from hint_t1 where a = 10;
QUERY PLAN
-----------------------------------------------
[Bypass]
Index Only Scan using hintt2_index on hint_t1
Index Cond: (a = 10)
(2 rows)
(3 rows)
create view hint_view1 as select /*+ tablescan(hint_t1)*/ * from hint_t1 where a = 10 and b = 10;
create view hint_view2 as select /*+ indexscan(hint_t1)*/ * from hint_t1 where a = 10 and b = 10;
@ -1836,9 +1840,10 @@ explain (costs off) select * from hint_view3;
explain (costs off) select * from hint_view4;
QUERY PLAN
-----------------------------------------------
[Bypass]
Index Only Scan using hintt1_index on hint_t1
Index Cond: (a = 10)
(2 rows)
(3 rows)
explain (costs off)select /*+ tablescan(t1) tablescan(t1) indexscan(t1) indexscan(t1) indexscan(t1 hintt1_index) indexscan(t1 hintt1_index)*/
* from hint_t1 as t1;

View File

@ -107,12 +107,13 @@ drop index idx2;
explain (verbose on, costs off) select sum(c2) from t1 where c2=3;
QUERY PLAN
-----------------------------------------------
[Bypass]
Aggregate
Output: sum(c2)
-> Index Only Scan using idx1 on public.t1
Output: c2
Index Cond: (t1.c2 = 3::numeric)
(5 rows)
(6 rows)
select sum(c2) from t1 where c2=3;
sum
@ -124,12 +125,13 @@ select sum(c2) from t1 where c2=3;
explain (verbose on, costs off) select sum(c3) from t1 where c2=3;
QUERY PLAN
------------------------------------------
[Bypass]
Aggregate
Output: sum(c3)
-> Index Scan using idx1 on public.t1
Output: c1, c2, c3, c4, colreal
Index Cond: (t1.c2 = 3::numeric)
(5 rows)
(6 rows)
select sum(c3) from t1 where c2=3;
sum
@ -143,42 +145,46 @@ create index idx3 on t1(c3, c2);
explain (verbose on, costs off) select sum(c3) from t1 where c3=3;
QUERY PLAN
-----------------------------------------------
[Bypass]
Aggregate
Output: sum(c3)
-> Index Only Scan using idx3 on public.t1
Output: c3, c2
Index Cond: (t1.c3 = 3::numeric)
(5 rows)
(6 rows)
explain (verbose on, costs off) select sum(c2) from t1 where c3=3;
QUERY PLAN
-----------------------------------------------
[Bypass]
Aggregate
Output: sum(c2)
-> Index Only Scan using idx3 on public.t1
Output: c3, c2
Index Cond: (t1.c3 = 3::numeric)
(5 rows)
(6 rows)
explain (verbose on, costs off) select sum(c3) from t1 where c2=3;
QUERY PLAN
-----------------------------------------------
[Bypass]
Aggregate
Output: sum(c3)
-> Index Only Scan using idx3 on public.t1
Output: c3, c2
Index Cond: (t1.c2 = 3::numeric)
(5 rows)
(6 rows)
explain (verbose on, costs off) select sum(c2) from t1 where c2=3;
QUERY PLAN
-----------------------------------------------
[Bypass]
Aggregate
Output: sum(c2)
-> Index Only Scan using idx3 on public.t1
Output: c3, c2
Index Cond: (t1.c2 = 3::numeric)
(5 rows)
(6 rows)
select sum(c3) from t1 where c3=3;
sum
@ -208,13 +214,14 @@ select sum(c2) from t1 where c2=3;
explain (verbose on, costs off) select c3 from t1 where c3 < 10 order by c2;
QUERY PLAN
-----------------------------------------------
[Bypass]
Sort
Output: c3, c2
Sort Key: t1.c2
-> Index Only Scan using idx3 on public.t1
Output: c3, c2
Index Cond: (t1.c3 < 10::numeric)
(6 rows)
(7 rows)
select c3 from t1 where c3 < 10 order by c2;
c3

View File

@ -13,10 +13,11 @@ insert into tab1_rr values (9, 2);
explain (costs off, verbose on, nodes off, num_nodes on) insert into tab1_rr values (9, 2);
QUERY PLAN
--------------------------
[Bypass]
Insert on public.tab1_rr
-> Result
Output: 9, 2
(3 rows)
(4 rows)
-- simple select
-- should get FQSed
@ -372,10 +373,11 @@ insert into tab1_hash values (9, 2);
explain (costs off, verbose on, nodes off) insert into tab1_hash values (9, 2);
QUERY PLAN
----------------------------
[Bypass]
Insert on public.tab1_hash
-> Result
Output: 9, 2
(3 rows)
(4 rows)
-- simple select
-- should get FQSed
@ -750,10 +752,11 @@ insert into tab1_modulo values (9, 2);
explain (costs off, verbose on, nodes off) insert into tab1_modulo values (9, 2);
QUERY PLAN
------------------------------
[Bypass]
Insert on public.tab1_modulo
-> Result
Output: 9, 2
(3 rows)
(4 rows)
-- simple select
-- should get FQSed
@ -1130,10 +1133,11 @@ insert into tab1_replicated values (9, 2);
explain (costs off, verbose on, nodes off) insert into tab1_replicated values (9, 2);
QUERY PLAN
----------------------------------
[Bypass]
Insert on public.tab1_replicated
-> Result
Output: 9, 2
(3 rows)
(4 rows)
-- simple select
select * from tab1_replicated;

View File

@ -95,10 +95,11 @@ ALTER TABLE xc_alter_table_2 DROP COLUMN e;
EXPLAIN (VERBOSE true, COSTS false, NODES false) INSERT INTO xc_alter_table_2 VALUES ('Kodek', false);
QUERY PLAN
----------------------------------------------------------------------------------------------------
[Bypass]
Insert on public.xc_alter_table_2
-> Result
Output: NULL::integer, 'Kodek'::character varying(20), false, NULL::integer, NULL::integer
(3 rows)
(4 rows)
INSERT INTO xc_alter_table_2 VALUES ('Kodek', false);
SELECT b, c FROM xc_alter_table_2 ORDER BY b;
@ -114,11 +115,12 @@ SELECT b, c FROM xc_alter_table_2 ORDER BY b;
EXPLAIN (VERBOSE true, COSTS false, NODES false) UPDATE xc_alter_table_2 SET b = 'Morphee', c = false WHERE b = 'Neo';
QUERY PLAN
------------------------------------------------------------------------------------------------------------
[Bypass]
Update on public.xc_alter_table_2
-> Index Scan using xc_alter_table_2_pkey on public.xc_alter_table_2
Output: NULL::integer, 'Morphee'::character varying(20), false, NULL::integer, NULL::integer, ctid
Index Cond: ((xc_alter_table_2.b)::text = 'Neo'::text)
(4 rows)
(5 rows)
UPDATE xc_alter_table_2 SET b = 'Morphee', c = false WHERE b = 'Neo';
SELECT b, c FROM xc_alter_table_2 ORDER BY b;
@ -137,10 +139,11 @@ ALTER TABLE xc_alter_table_2 ADD COLUMN a2 varchar(20);
EXPLAIN (VERBOSE true, COSTS false, NODES false) INSERT INTO xc_alter_table_2 (a, a2, b, c) VALUES (100, 'CEO', 'Gordon', true);
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------
[Bypass]
Insert on public.xc_alter_table_2
-> Result
Output: NULL::integer, 'Gordon'::character varying(20), true, NULL::integer, NULL::integer, 100, 'CEO'::character varying(20)
(3 rows)
(4 rows)
INSERT INTO xc_alter_table_2 (a, a2, b, c) VALUES (100, 'CEO', 'Gordon', true);
SELECT a, a2, b, c FROM xc_alter_table_2 ORDER BY b;
@ -157,11 +160,12 @@ SELECT a, a2, b, c FROM xc_alter_table_2 ORDER BY b;
EXPLAIN (VERBOSE true, COSTS false, NODES false) UPDATE xc_alter_table_2 SET a = 200, a2 = 'CTO' WHERE b = 'John';
QUERY PLAN
------------------------------------------------------------------------------------------------------------
[Bypass]
Update on public.xc_alter_table_2
-> Index Scan using xc_alter_table_2_pkey on public.xc_alter_table_2
Output: NULL::integer, b, c, NULL::integer, NULL::integer, 200, 'CTO'::character varying(20), ctid
Index Cond: ((xc_alter_table_2.b)::text = 'John'::text)
(4 rows)
(5 rows)
UPDATE xc_alter_table_2 SET a = 200, a2 = 'CTO' WHERE b = 'John';
SELECT a, a2, b, c FROM xc_alter_table_2 ORDER BY b;