Fix bfv_partition to avoid explain_format by atmsort [#143465051]

bfv_partition was migrated from TINC, which didn't seem to filter output
through atmsort.pl . This presents us a surprise: a lot of our queries
will trigger an "EXPLAIN re-format" in atmsort where we did NOT intend
it to happen: we already run PL/Python over the EXPLAIN output to count
operators. This surprising behavior also crept up on us when we had a
test failure, and we saw out-of-order output lines in the diff.

This commit fixes that.
上级 df5460ea
......@@ -7,9 +7,9 @@ set search_path=bfv_partition;
create language plpythonu;
ERROR: language "plpythonu" already exists
-- end_ignore
create or replace function count_operator(explain_query text, operator text) returns int as
create or replace function count_operator(query text, operator text) returns int as
$$
rv = plpy.execute(explain_query)
rv = plpy.execute('EXPLAIN' + query)
search_text = operator
result = 0
for i in range(len(rv)):
......@@ -21,7 +21,7 @@ $$
language plpythonu;
create or replace function find_operator(query text, operator_name text) returns text as
$$
rv = plpy.execute(query)
rv = plpy.execute('EXPLAIN' + query)
search_text = operator_name
result = ['false']
for i in range(len(rv)):
......@@ -63,7 +63,7 @@ NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_5" for table "mpp7980
NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_6" for table "mpp7980"
-- TEST
select count_operator('explain select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
select count_operator('select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
count_operator
----------------
0
......@@ -551,7 +551,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
insert into mpp23195_t1 values (generate_series(1,19));
insert into mpp23195_t2 values (1);
-- TEST
select find_operator('explain select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
select find_operator('select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
find_operator
---------------
['false']
......@@ -602,13 +602,13 @@ select disable_xform('CXformInnerJoin2HashJoin');
(1 row)
-- end_ignore
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
find_operator
---------------
['false']
(1 row)
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
find_operator
---------------
['true']
......@@ -655,7 +655,7 @@ NOTICE: CREATE TABLE will create partition "mpp23288_1_prt_plast" for table "mp
insert into mpp23288(a) select generate_series(1,20);
analyze mpp23288;
-- TEST
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
0
......@@ -675,7 +675,7 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2
10 | 9
(9 rows)
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
0
......@@ -710,7 +710,7 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t
12 | 11
(24 rows)
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
0
......@@ -1042,7 +1042,7 @@ select disable_xform('CXformDynamicGet2DynamicTableScan');
(1 row)
-- end_ignore
select count_operator('explain select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
select count_operator('select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
count_operator
----------------
6
......@@ -1315,61 +1315,61 @@ analyze p2;
analyze p3;
analyze p;
-- TEST
select count_operator('explain select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
0
......@@ -1457,7 +1457,7 @@ NOTICE: building index for child partition "dbs_1_prt_8"
NOTICE: building index for child partition "dbs_1_prt_9"
NOTICE: building index for child partition "dbs_1_prt_10"
-- TEST
select find_operator('explain (select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
select find_operator('(select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
find_operator
---------------
['false']
......@@ -1485,7 +1485,7 @@ select disable_xform('CXformDynamicGet2DynamicTableScan');
(1 row)
-- end_ignore
select find_operator('explain (select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
select find_operator('(select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
find_operator
---------------
['false']
......@@ -1505,7 +1505,7 @@ select find_operator('explain (select * from dis where c3 = 1) union (select * f
----+----+----
(0 rows)
select find_operator('explain select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
select find_operator('select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
find_operator
---------------
['false']
......@@ -1576,7 +1576,7 @@ select * from pp where b=2 and c=2;
---+---+---
(0 rows)
select count_operator('explain select * from pp where b=2 and c=2;','Partition Selector');
select count_operator('select * from pp where b=2 and c=2;','Partition Selector');
count_operator
----------------
0
......@@ -1637,7 +1637,7 @@ select * from ds_4 where month_id = '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id = E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id = E''200800'';','Partition Selector');
count_operator
----------------
0
......@@ -1648,7 +1648,7 @@ select * from ds_4 where month_id > '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id > E''200800'';','Partition Selector');
count_operator
----------------
0
......@@ -1659,7 +1659,7 @@ select * from ds_4 where month_id <= '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id <= E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id <= E''200800'';','Partition Selector');
count_operator
----------------
0
......@@ -1670,7 +1670,7 @@ select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id >
----------+----------------+-----------+----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
count_operator
----------------
1
......
......@@ -7,9 +7,9 @@ set search_path=bfv_partition;
create language plpythonu;
ERROR: language "plpythonu" already exists
-- end_ignore
create or replace function count_operator(explain_query text, operator text) returns int as
create or replace function count_operator(query text, operator text) returns int as
$$
rv = plpy.execute(explain_query)
rv = plpy.execute('EXPLAIN ' + query)
search_text = operator
result = 0
for i in range(len(rv)):
......@@ -21,7 +21,7 @@ $$
language plpythonu;
create or replace function find_operator(query text, operator_name text) returns text as
$$
rv = plpy.execute(query)
rv = plpy.execute('EXPLAIN ' + query)
search_text = operator_name
result = ['false']
for i in range(len(rv)):
......@@ -63,7 +63,7 @@ NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_5" for table "mpp7980
NOTICE: CREATE TABLE will create partition "mpp7980_1_prt_6" for table "mpp7980"
-- TEST
select count_operator('explain select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
select count_operator('select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
count_operator
----------------
0
......@@ -551,7 +551,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
insert into mpp23195_t1 values (generate_series(1,19));
insert into mpp23195_t2 values (1);
-- TEST
select find_operator('explain select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
select find_operator('select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
find_operator
---------------
['true']
......@@ -602,13 +602,13 @@ select disable_xform('CXformInnerJoin2HashJoin');
(1 row)
-- end_ignore
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
find_operator
---------------
['false']
(1 row)
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
find_operator
---------------
['true']
......@@ -655,7 +655,7 @@ NOTICE: CREATE TABLE will create partition "mpp23288_1_prt_plast" for table "mp
insert into mpp23288(a) select generate_series(1,20);
analyze mpp23288;
-- TEST
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
2
......@@ -675,7 +675,7 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2
10 | 9
(9 rows)
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
2
......@@ -710,7 +710,7 @@ select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t
12 | 11
(24 rows)
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
count_operator
----------------
2
......@@ -1042,7 +1042,7 @@ select disable_xform('CXformDynamicGet2DynamicTableScan');
(1 row)
-- end_ignore
select count_operator('explain select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
select count_operator('select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
count_operator
----------------
0
......@@ -1315,61 +1315,61 @@ analyze p2;
analyze p3;
analyze p;
-- TEST
select count_operator('explain select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
3
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
3
(1 row)
select count_operator('explain select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
count_operator
----------------
2
......@@ -1457,7 +1457,7 @@ NOTICE: building index for child partition "dbs_1_prt_8"
NOTICE: building index for child partition "dbs_1_prt_9"
NOTICE: building index for child partition "dbs_1_prt_10"
-- TEST
select find_operator('explain (select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
select find_operator('(select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
find_operator
---------------
['true']
......@@ -1485,7 +1485,7 @@ select disable_xform('CXformDynamicGet2DynamicTableScan');
(1 row)
-- end_ignore
select find_operator('explain (select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
select find_operator('(select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
find_operator
---------------
['true']
......@@ -1505,7 +1505,7 @@ select find_operator('explain (select * from dis where c3 = 1) union (select * f
----+----+----
(0 rows)
select find_operator('explain select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
select find_operator('select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
find_operator
---------------
['false']
......@@ -1576,7 +1576,7 @@ select * from pp where b=2 and c=2;
---+---+---
(0 rows)
select count_operator('explain select * from pp where b=2 and c=2;','Partition Selector');
select count_operator('select * from pp where b=2 and c=2;','Partition Selector');
count_operator
----------------
0
......@@ -1637,7 +1637,7 @@ select * from ds_4 where month_id = '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id = E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id = E''200800'';','Partition Selector');
count_operator
----------------
1
......@@ -1648,7 +1648,7 @@ select * from ds_4 where month_id > '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id > E''200800'';','Partition Selector');
count_operator
----------------
1
......@@ -1659,7 +1659,7 @@ select * from ds_4 where month_id <= '200800';
----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 where month_id <= E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id <= E''200800'';','Partition Selector');
count_operator
----------------
1
......@@ -1670,7 +1670,7 @@ select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id >
----------+----------------+-----------+----------+----------------+-----------
(0 rows)
select count_operator('explain select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
count_operator
----------------
2
......
......@@ -8,9 +8,9 @@ set search_path=bfv_partition;
create language plpythonu;
-- end_ignore
create or replace function count_operator(explain_query text, operator text) returns int as
create or replace function count_operator(query text, operator text) returns int as
$$
rv = plpy.execute(explain_query)
rv = plpy.execute('EXPLAIN ' + query)
search_text = operator
result = 0
for i in range(len(rv)):
......@@ -23,7 +23,7 @@ language plpythonu;
create or replace function find_operator(query text, operator_name text) returns text as
$$
rv = plpy.execute(query)
rv = plpy.execute('EXPLAIN ' + query)
search_text = operator_name
result = ['false']
for i in range(len(rv)):
......@@ -60,7 +60,7 @@ distributed by (subscription_id, bill_stmt_id)
);
-- TEST
select count_operator('explain select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
select count_operator('select cust_type, subscription_status,count(distinct subscription_id),sum(voice_call_min),sum(minute_per_call) from mpp7980 where month_id =E''2009-04-01'' group by rollup(1,2);','SIGSEGV');
insert into mpp7980 values('2009-04-01','xyz','zyz','1',1,1,'1');
insert into mpp7980 values('2009-04-01','zxyz','zyz','2',2,1,'1');
......@@ -259,7 +259,7 @@ insert into mpp23195_t1 values (generate_series(1,19));
insert into mpp23195_t2 values (1);
-- TEST
select find_operator('explain select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
select find_operator('select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;', 'Dynamic Index Scan');
select * from mpp23195_t1,mpp23195_t2 where mpp23195_t1.i < mpp23195_t2.i;
-- CLEANUP
......@@ -293,8 +293,8 @@ create table mpp21834_t2(i int, j int);
-- start_ignore
select disable_xform('CXformInnerJoin2HashJoin');
-- end_ignore
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
select find_operator('explain analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Dynamic Index Scan');
select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp21834_t2.i < mpp21834_t1.i;','Nested Loop');
-- CLEANUP
-- start_ignore
......@@ -329,13 +329,13 @@ insert into mpp23288(a) select generate_series(1,20);
analyze mpp23288;
-- TEST
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;','Dynamic Table Scan');
select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and t2.a =10) order by t2.a, t1.a;
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;','Dynamic Table Scan');
select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on (t1.a < t2.a and (t2.a = 10 or t2.a = 5 or t2.a = 12)) order by t2.a, t1.a;
select count_operator('explain select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
select count_operator('select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;','Dynamic Table Scan');
select t2.a, t1.a from mpp23288 as t1 join mpp23288 as t2 on t1.a < t2.a and t2.a = 1 or t2.a < 10 order by t2.a, t1.a;
-- CLEANUP
......@@ -417,7 +417,7 @@ analyze mpp24151_t;
select disable_xform('CXformDynamicGet2DynamicTableScan');
-- end_ignore
select count_operator('explain select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
select count_operator('select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = E''hello0'';','Result');
select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = 'hello0';
-- CLEANUP
......@@ -466,25 +466,25 @@ analyze p3;
analyze p;
-- TEST
select count_operator('explain select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 except select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 union all select * from p) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p union all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p2 intersect all select * from p3) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('explain select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
select count_operator('select * from (select * from p1 union select * from p intersect all select * from p2) as p_all, t where p_all.b=t.b;','Partition Selector');
-- CLEANUP
-- start_ignore
......@@ -515,7 +515,7 @@ create index dbs_index on dbs using bitmap(c3);
-- TEST
select find_operator('explain (select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
select find_operator('(select * from dts where c2 = 1) union (select * from dts where c2 = 2) union (select * from dts where c2 = 3) union (select * from dts where c2 = 4) union (select * from dts where c2 = 5) union (select * from dts where c2 = 6) union (select * from dts where c2 = 7) union (select * from dts where c2 = 8) union (select * from dts where c2 = 9) union (select * from dts where c2 = 10);', 'Dynamic Table Scan');
(select * from dts where c2 = 1) union
(select * from dts where c2 = 2) union
......@@ -532,7 +532,7 @@ select find_operator('explain (select * from dts where c2 = 1) union (select * f
select disable_xform('CXformDynamicGet2DynamicTableScan');
-- end_ignore
select find_operator('explain (select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
select find_operator('(select * from dis where c3 = 1) union (select * from dis where c3 = 2) union (select * from dis where c3 = 3) union (select * from dis where c3 = 4) union (select * from dis where c3 = 5) union (select * from dis where c3 = 6) union (select * from dis where c3 = 7) union (select * from dis where c3 = 8) union (select * from dis where c3 = 9) union (select * from dis where c3 = 10);', 'Dynamic Index Scan');
(select * from dis where c3 = 1) union
(select * from dis where c3 = 2) union
......@@ -545,7 +545,7 @@ select find_operator('explain (select * from dis where c3 = 1) union (select * f
(select * from dis where c3 = 9) union
(select * from dis where c3 = 10);
select find_operator('explain select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
select find_operator('select * from dbs where c2= 15 and c3 = 5;', 'Bitmap Table Scan');
select * from dbs where c2= 15 and c3 = 5;
......@@ -585,7 +585,7 @@ select disable_xform('CXformDynamicGet2DynamicTableScan') ;
-- end_ignore
select * from pp where b=2 and c=2;
select count_operator('explain select * from pp where b=2 and c=2;','Partition Selector');
select count_operator('select * from pp where b=2 and c=2;','Partition Selector');
-- CLEANUP
-- start_ignore
......@@ -628,16 +628,16 @@ PARTITION BY LIST(month_id)
-- TEST
select * from ds_4 where month_id = '200800';
select count_operator('explain select * from ds_4 where month_id = E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id = E''200800'';','Partition Selector');
select * from ds_4 where month_id > '200800';
select count_operator('explain select * from ds_4 where month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id > E''200800'';','Partition Selector');
select * from ds_4 where month_id <= '200800';
select count_operator('explain select * from ds_4 where month_id <= E''200800'';','Partition Selector');
select count_operator('select * from ds_4 where month_id <= E''200800'';','Partition Selector');
select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > '200800';
select count_operator('explain select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
select count_operator('select * from ds_4 a1,ds_4 a2 where a1.month_id = a2.month_id and a1.month_id > E''200800'';','Partition Selector');
-- CLEANUP
-- start_ignore
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册