提交 13e54b38 编写于 作者: H Heikki Linnakangas

Add test case for EXPLAIN of Sequence-PartitionSelector plans.

I noticed while debugging an issue with PartitionSelectors on the 8.3
merge branch, that we don't have a test case for this.
上级 e8506d2d
......@@ -8131,6 +8131,22 @@ select * from orca.t order by 1,2;
201208 | 2 | tag1 | tag2
(7 rows)
-- test EXPLAIN support of partition selection nodes, while we're at it.
explain select * from orca.t order by 1,2;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..431.00 rows=1 width=32)
Merge Key: timest, user_id
-> Sequence (cost=0.00..431.00 rows=1 width=32)
-> Partition Selector for t (dynamic scan id: 1) (cost=10.00..100.00 rows=50 width=4)
Partitions selected: 6 (out of 6)
-> Sort (cost=0.00..431.00 rows=1 width=32)
Sort Key: timest, user_id
-> Dynamic Table Scan on t (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=32)
Settings: optimizer=on; optimizer_segments=3
Optimizer status: PQO version 1.630
(10 rows)
select tag2, tag1 from orca.t order by 1, 2;;
tag2 | tag1
-------+-------
......
......@@ -8132,6 +8132,24 @@ select * from orca.t order by 1,2;
201208 | 2 | tag1 | tag2
(7 rows)
-- test EXPLAIN support of partition selection nodes, while we're at it.
explain select * from orca.t order by 1,2;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Gather Motion 2:1 (slice1; segments: 2) (cost=16113.11..16515.11 rows=160800 width=92)
Merge Key: orca.t.timest, orca.t.user_id
-> Sort (cost=16113.11..16515.11 rows=80400 width=92)
Sort Key: orca.t.timest, orca.t.user_id
-> Append (cost=0.00..2208.00 rows=80400 width=92)
-> Append-only Columnar Scan on t_1_prt_part201203 t (cost=0.00..368.00 rows=13400 width=92)
-> Append-only Scan on t_1_prt_part201204 t (cost=0.00..368.00 rows=13400 width=92)
-> Seq Scan on t_1_prt_part201205 t (cost=0.00..368.00 rows=13400 width=92)
-> Append-only Columnar Scan on t_1_prt_part201206 t (cost=0.00..368.00 rows=13400 width=92)
-> Append-only Scan on t_1_prt_part201207 t (cost=0.00..368.00 rows=13400 width=92)
-> Seq Scan on t_1_prt_part201208 t (cost=0.00..368.00 rows=13400 width=92)
Settings: optimizer=off; optimizer_segments=3
(12 rows)
select tag2, tag1 from orca.t order by 1, 2;;
tag2 | tag1
-------+-------
......
......@@ -475,6 +475,9 @@ insert into orca.t values('201208',2,'tag1','tag2');
-- test projections
select * from orca.t order by 1,2;
-- test EXPLAIN support of partition selection nodes, while we're at it.
explain select * from orca.t order by 1,2;
select tag2, tag1 from orca.t order by 1, 2;;
select tag1, user_id from orca.t order by 1, 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册