diff options
| author | Robert Haas | 2017-02-19 10:23:59 +0000 |
|---|---|---|
| committer | Robert Haas | 2017-02-19 10:27:55 +0000 |
| commit | 0414b26bac09379a4cbf1fbd847d1cee2293c5e4 (patch) | |
| tree | 16554f77178d068e27bd53c2404a6f8468c90746 /src/test | |
| parent | 16be2fd100199bdf284becfcee02c5eb20d8a11d (diff) | |
Add optimizer and executor support for parallel index-only scans.
Commit 5262f7a4fc44f651241d2ff1fa688dd664a34874 added similar support
for parallel index scans; this extends that work to index-only scans.
As with parallel index scans, this requires support from the index AM,
so currently parallel index-only scans will only be possible for btree
indexes.
Rafia Sabih, reviewed and tested by Rahila Syed, Tushar Ahuja,
and Amit Kapila
Discussion: http://postgr.es/m/CAOGQiiPEAs4C=TBp0XShxBvnWXuzGL2u++Hm1=qnCpd6_Mf8Fw@mail.gmail.com
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/select_parallel.out | 29 | ||||
| -rw-r--r-- | src/test/regress/sql/select_parallel.sql | 5 |
2 files changed, 30 insertions, 4 deletions
diff --git a/src/test/regress/expected/select_parallel.out b/src/test/regress/expected/select_parallel.out index 48fb80e90c..a5a22323c1 100644 --- a/src/test/regress/expected/select_parallel.out +++ b/src/test/regress/expected/select_parallel.out @@ -92,12 +92,14 @@ explain (costs off) explain (costs off) select sum(parallel_restricted(unique1)) from tenk1 group by(parallel_restricted(unique1)); - QUERY PLAN ----------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- HashAggregate Group Key: parallel_restricted(unique1) - -> Index Only Scan using tenk1_unique1 on tenk1 -(3 rows) + -> Gather + Workers Planned: 4 + -> Parallel Index Only Scan using tenk1_unique1 on tenk1 +(5 rows) -- test parallel plans for queries containing un-correlated subplans. alter table tenk2 set (parallel_workers = 0); @@ -146,6 +148,25 @@ select count((unique1)) from tenk1 where hundred > 1; 9800 (1 row) +-- test parallel index-only scans. +explain (costs off) + select count(*) from tenk1 where thousand > 95; + QUERY PLAN +-------------------------------------------------------------------------------- + Finalize Aggregate + -> Gather + Workers Planned: 4 + -> Partial Aggregate + -> Parallel Index Only Scan using tenk1_thous_tenthous on tenk1 + Index Cond: (thousand > 95) +(6 rows) + +select count(*) from tenk1 where thousand > 95; + count +------- + 9040 +(1 row) + reset enable_seqscan; reset enable_bitmapscan; set force_parallel_mode=1; diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql index f5bc4d1873..d72addf5a2 100644 --- a/src/test/regress/sql/select_parallel.sql +++ b/src/test/regress/sql/select_parallel.sql @@ -56,6 +56,11 @@ explain (costs off) select count((unique1)) from tenk1 where hundred > 1; select count((unique1)) from tenk1 where hundred > 1; +-- test parallel index-only scans. +explain (costs off) + select count(*) from tenk1 where thousand > 95; +select count(*) from tenk1 where thousand > 95; + reset enable_seqscan; reset enable_bitmapscan; |
