Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions src/test/regress/expected/gp_parallel.out
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,77 @@ commit;
drop table ao1;
drop table ao2;
drop table aocs1;
-- test Parallel Bitmap Heap Scan
begin;
create table t1(c1 int, c2 int) with(parallel_workers=2) distributed by (c1);
set local enable_parallel = on;
create index on t1(c2);
insert into t1 select i, i from generate_series(1, 10000000) i;
analyze t1;
set local force_parallel_mode = 1;
set local enable_seqscan = off;
explain(locus, costs off) select c2 from t1;
QUERY PLAN
--------------------------------------------
Gather Motion 6:1 (slice1; segments: 6)
Locus: Entry
-> Parallel Bitmap Heap Scan on t1
Locus: HashedWorkers
Parallel Workers: 2
-> Bitmap Index Scan on t1_c2_idx
Locus: NULL
Optimizer: Postgres query optimizer
(8 rows)

-- results check
explain(locus, costs off) select count(c2) from t1;
QUERY PLAN
--------------------------------------------------------
Finalize Aggregate
Locus: Entry
-> Gather Motion 6:1 (slice1; segments: 6)
Locus: Entry
-> Partial Aggregate
Locus: HashedWorkers
Parallel Workers: 2
-> Parallel Bitmap Heap Scan on t1
Locus: HashedWorkers
Parallel Workers: 2
-> Bitmap Index Scan on t1_c2_idx
Locus: NULL
Optimizer: Postgres query optimizer
(13 rows)

select count(c2) from t1;
count
----------
10000000
(1 row)

set local enable_parallel = off;
explain(locus, costs off) select count(c2) from t1;
QUERY PLAN
--------------------------------------------------------
Finalize Aggregate
Locus: Entry
-> Gather Motion 3:1 (slice1; segments: 3)
Locus: Entry
-> Partial Aggregate
Locus: Hashed
-> Bitmap Heap Scan on t1
Locus: Hashed
-> Bitmap Index Scan on t1_c2_idx
Locus: NULL
Optimizer: Postgres query optimizer
(11 rows)

select count(c2) from t1;
count
----------
10000000
(1 row)

abort;
-- test gp_appendonly_insert_files doesn't take effect
begin;
create table t (x int);
Expand Down
18 changes: 18 additions & 0 deletions src/test/regress/sql/gp_parallel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ drop table ao1;
drop table ao2;
drop table aocs1;

-- test Parallel Bitmap Heap Scan
begin;
create table t1(c1 int, c2 int) with(parallel_workers=2) distributed by (c1);
set local enable_parallel = on;
create index on t1(c2);
insert into t1 select i, i from generate_series(1, 10000000) i;
analyze t1;
set local force_parallel_mode = 1;
set local enable_seqscan = off;
explain(locus, costs off) select c2 from t1;
-- results check
explain(locus, costs off) select count(c2) from t1;
select count(c2) from t1;
set local enable_parallel = off;
explain(locus, costs off) select count(c2) from t1;
select count(c2) from t1;
abort;


-- test gp_appendonly_insert_files doesn't take effect
begin;
Expand Down