mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
Add some more tests for tuple routing.
Commit a25665088d
fixed some issues with
how PartitionDispatch related code handled multi-level partitioned
tables, but didn't add any tests.
Discussion: http://postgr.es/m/CA%2BTgmoZ86v1G%2Bzx9etMiSQaBBvYMKfU-iitqZArSh5z0n8Q4cA%40mail.gmail.com
Amit Langote, per a complaint from me.
This commit is contained in:
parent
262e821dec
commit
d26fa4fd47
@ -285,6 +285,34 @@ select tableoid::regclass, * from list_parted;
|
||||
part_ee_ff2 | EE | 10
|
||||
(8 rows)
|
||||
|
||||
-- some more tests to exercise tuple-routing with multi-level partitioning
|
||||
create table part_gg partition of list_parted for values in ('gg') partition by range (b);
|
||||
create table part_gg1 partition of part_gg for values from (unbounded) to (1);
|
||||
create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
|
||||
create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
|
||||
create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
|
||||
create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
|
||||
create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
|
||||
create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
|
||||
truncate list_parted;
|
||||
insert into list_parted values ('aa'), ('cc');
|
||||
insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
|
||||
insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
|
||||
insert into list_parted (b) values (1);
|
||||
select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
|
||||
tableoid | a | min_b | max_b
|
||||
---------------+----+-------+-------
|
||||
part_aa_bb | aa | |
|
||||
part_cc_dd | cc | |
|
||||
part_ee_ff1 | Ff | 1 | 9
|
||||
part_ee_ff2 | Ff | 10 | 19
|
||||
part_ee_ff3_1 | Ff | 20 | 24
|
||||
part_ee_ff3_2 | Ff | 25 | 29
|
||||
part_gg2_1 | gg | 1 | 4
|
||||
part_gg2_2 | gg | 5 | 9
|
||||
part_null | | 1 | 1
|
||||
(9 rows)
|
||||
|
||||
-- cleanup
|
||||
drop table range_parted cascade;
|
||||
NOTICE: drop cascades to 4 other objects
|
||||
@ -293,13 +321,21 @@ drop cascades to table part2
|
||||
drop cascades to table part3
|
||||
drop cascades to table part4
|
||||
drop table list_parted cascade;
|
||||
NOTICE: drop cascades to 6 other objects
|
||||
NOTICE: drop cascades to 14 other objects
|
||||
DETAIL: drop cascades to table part_aa_bb
|
||||
drop cascades to table part_cc_dd
|
||||
drop cascades to table part_null
|
||||
drop cascades to table part_ee_ff
|
||||
drop cascades to table part_ee_ff1
|
||||
drop cascades to table part_ee_ff2
|
||||
drop cascades to table part_ee_ff3
|
||||
drop cascades to table part_ee_ff3_1
|
||||
drop cascades to table part_ee_ff3_2
|
||||
drop cascades to table part_gg
|
||||
drop cascades to table part_gg1
|
||||
drop cascades to table part_gg2
|
||||
drop cascades to table part_gg2_1
|
||||
drop cascades to table part_gg2_2
|
||||
-- more tests for certain multi-level partitioning scenarios
|
||||
create table p (a int, b int) partition by range (a, b);
|
||||
create table p1 (b int, a int not null) partition by range (b);
|
||||
|
@ -167,6 +167,24 @@ insert into list_parted values ('EE', 1);
|
||||
insert into part_ee_ff values ('EE', 10);
|
||||
select tableoid::regclass, * from list_parted;
|
||||
|
||||
-- some more tests to exercise tuple-routing with multi-level partitioning
|
||||
create table part_gg partition of list_parted for values in ('gg') partition by range (b);
|
||||
create table part_gg1 partition of part_gg for values from (unbounded) to (1);
|
||||
create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
|
||||
create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
|
||||
create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
|
||||
|
||||
create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
|
||||
create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
|
||||
create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
|
||||
|
||||
truncate list_parted;
|
||||
insert into list_parted values ('aa'), ('cc');
|
||||
insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
|
||||
insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
|
||||
insert into list_parted (b) values (1);
|
||||
select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
|
||||
|
||||
-- cleanup
|
||||
drop table range_parted cascade;
|
||||
drop table list_parted cascade;
|
||||
|
Loading…
Reference in New Issue
Block a user