aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/select_parallel.sql
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-02-14 18:09:47 -0500
committerRobert Haas <rhaas@postgresql.org>2017-02-14 18:16:03 -0500
commit5e6d8d2bbbcace304450b309e79366c0da4063e4 (patch)
treed5068ced430d295491c0b34c39415e8f49fad6da /src/test/regress/sql/select_parallel.sql
parent8da9a226369e9ceec7cef1ab7a16cdc0adb4d657 (diff)
downloadpostgresql-5e6d8d2bbbcace304450b309e79366c0da4063e4.tar.gz
postgresql-5e6d8d2bbbcace304450b309e79366c0da4063e4.zip
Allow parallel workers to execute subplans.
This doesn't do anything to make Param nodes anything other than parallel-restricted, so this only helps with uncorrelated subplans, and it's not necessarily very cheap because each worker will run the subplan separately (just as a Hash Join will build a separate copy of the hash table in each participating process), but it's a first step toward supporting cases that are more likely to help in practice, and is occasionally useful on its own. Amit Kapila, reviewed and tested by Rafia Sabih, Dilip Kumar, and me. Discussion: http://postgr.es/m/CAA4eK1+e8Z45D2n+rnDMDYsVEb5iW7jqaCH_tvPMYau=1Rru9w@mail.gmail.com
Diffstat (limited to 'src/test/regress/sql/select_parallel.sql')
-rw-r--r--src/test/regress/sql/select_parallel.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql
index 8b4090f2ec1..def9939d2e6 100644
--- a/src/test/regress/sql/select_parallel.sql
+++ b/src/test/regress/sql/select_parallel.sql
@@ -39,6 +39,15 @@ explain (costs off)
select sum(parallel_restricted(unique1)) from tenk1
group by(parallel_restricted(unique1));
+-- test parallel plans for queries containing un-correlated subplans.
+alter table tenk2 set (parallel_workers = 0);
+explain (costs off)
+ select count(*) from tenk1 where (two, four) not in
+ (select hundred, thousand from tenk2 where thousand > 100);
+select count(*) from tenk1 where (two, four) not in
+ (select hundred, thousand from tenk2 where thousand > 100);
+alter table tenk2 reset (parallel_workers);
+
set force_parallel_mode=1;
explain (costs off)