forbid parallel right join or full join
This commit is contained in:
@ -404,7 +404,7 @@ select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_
|
||||
(3 rows)
|
||||
|
||||
insert into interval_sales values (generate_series(1,10), generate_series(1,10), generate_series(TO_DATE('2020-01-01', 'YYYY-MM-DD'),TO_DATE('2020-07-01', 'YYYY-MM-DD'),'1 day'), 1, 1, 1, 1);
|
||||
select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_toastrelid, boundaries from pg_partition;
|
||||
select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_toastrelid, boundaries from pg_partition order by relname;
|
||||
relname | has_toastrelid | boundaries
|
||||
----------------+----------------+------------------------------
|
||||
interval_sales | FALSE |
|
||||
|
||||
@ -4,18 +4,20 @@ insert into parallel_hashjoin_test_a select n from generate_series(1,1000) n;
|
||||
insert into parallel_hashjoin_test_b select n from generate_series(1,10) n;
|
||||
analyse parallel_hashjoin_test_a;
|
||||
analyse parallel_hashjoin_test_b;
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------
|
||||
Hash Left Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Seq Scan on parallel_hashjoin_test_a
|
||||
Filter: (id < 10)
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(6 rows)
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------
|
||||
Sort
|
||||
Sort Key: parallel_hashjoin_test_a.id
|
||||
-> Hash Left Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Seq Scan on parallel_hashjoin_test_a
|
||||
Filter: (id < 10)
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(8 rows)
|
||||
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
id | id
|
||||
----+----
|
||||
1 | 1
|
||||
@ -33,20 +35,22 @@ set parallel_setup_cost = 1;
|
||||
set min_parallel_table_scan_size=0;
|
||||
set parallel_tuple_cost = 0.01;
|
||||
set enable_nestloop=off;
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------
|
||||
Gather
|
||||
Number of Workers: 2
|
||||
-> Hash Left Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Parallel Seq Scan on parallel_hashjoin_test_a
|
||||
Filter: (id < 10)
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(8 rows)
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------
|
||||
Sort
|
||||
Sort Key: parallel_hashjoin_test_a.id
|
||||
-> Gather
|
||||
Number of Workers: 2
|
||||
-> Hash Left Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Parallel Seq Scan on parallel_hashjoin_test_a
|
||||
Filter: (id < 10)
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(10 rows)
|
||||
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
id | id
|
||||
----+----
|
||||
1 | 1
|
||||
@ -61,18 +65,20 @@ select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b
|
||||
(9 rows)
|
||||
|
||||
-- Forbid parallel Hash Right Join or Hash Full Join.
|
||||
explain (costs off)select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------
|
||||
Hash Right Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Seq Scan on parallel_hashjoin_test_a
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(5 rows)
|
||||
explain (costs off)select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id order by parallel_hashjoin_test_a.id;
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------
|
||||
Sort
|
||||
Sort Key: parallel_hashjoin_test_a.id
|
||||
-> Hash Right Join
|
||||
Hash Cond: (parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id)
|
||||
-> Seq Scan on parallel_hashjoin_test_a
|
||||
-> Hash
|
||||
-> Seq Scan on parallel_hashjoin_test_b
|
||||
(7 rows)
|
||||
|
||||
select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id;
|
||||
id | id
|
||||
select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id order by parallel_hashjoin_test_a.id;
|
||||
id | id
|
||||
----+----
|
||||
1 | 1
|
||||
2 | 2
|
||||
|
||||
@ -326,7 +326,7 @@ select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_
|
||||
|
||||
insert into interval_sales values (generate_series(1,10), generate_series(1,10), generate_series(TO_DATE('2020-01-01', 'YYYY-MM-DD'),TO_DATE('2020-07-01', 'YYYY-MM-DD'),'1 day'), 1, 1, 1, 1);
|
||||
|
||||
select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_toastrelid, boundaries from pg_partition;
|
||||
select relname, case when reltoastrelid > 0 then 'TRUE' else 'FALSE' end as has_toastrelid, boundaries from pg_partition order by relname;
|
||||
|
||||
drop table interval_sales;
|
||||
|
||||
|
||||
@ -4,19 +4,19 @@ insert into parallel_hashjoin_test_a select n from generate_series(1,1000) n;
|
||||
insert into parallel_hashjoin_test_b select n from generate_series(1,10) n;
|
||||
analyse parallel_hashjoin_test_a;
|
||||
analyse parallel_hashjoin_test_b;
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
|
||||
set parallel_setup_cost = 1;
|
||||
set min_parallel_table_scan_size=0;
|
||||
set parallel_tuple_cost = 0.01;
|
||||
set enable_nestloop=off;
|
||||
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10;
|
||||
explain (costs off) select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
select * from parallel_hashjoin_test_a left outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id where parallel_hashjoin_test_a.id < 10 order by parallel_hashjoin_test_a.id;
|
||||
-- Forbid parallel Hash Right Join or Hash Full Join.
|
||||
explain (costs off)select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id;
|
||||
select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id;
|
||||
explain (costs off)select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id order by parallel_hashjoin_test_a.id;
|
||||
select * from parallel_hashjoin_test_a right outer join parallel_hashjoin_test_b on parallel_hashjoin_test_a.id = parallel_hashjoin_test_b.id order by parallel_hashjoin_test_a.id;
|
||||
|
||||
reset parallel_setup_cost;
|
||||
reset min_parallel_table_scan_size;
|
||||
|
||||
Reference in New Issue
Block a user