!2669 1.修复Insert ... Select 列存分区表时,检查分区信息是否一致时,没有考虑分区类型导致代码逻辑出错的问题。
Merge pull request !2669 from playrest/master-commit-2
This commit is contained in:
@ -199,6 +199,11 @@ bool checkPartitionBoundary(Relation insert_rel, Relation scan_rel)
|
|||||||
List* insert_rel_boundary = NIL;
|
List* insert_rel_boundary = NIL;
|
||||||
List* scan_rel_boundary = NIL;
|
List* scan_rel_boundary = NIL;
|
||||||
|
|
||||||
|
/* Now support List/Hash partition, check partition type, only Range partitions are supported here */
|
||||||
|
if (!PartitionMapIsRange(insert_rel->partMap) || !PartitionMapIsRange(scan_rel->partMap)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (insert_rel_range_num != scan_rel_range_num) {
|
if (insert_rel_range_num != scan_rel_range_num) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
|
create schema schema_hw_cstore_partition;
|
||||||
|
set search_path = schema_hw_cstore_partition;
|
||||||
--test create
|
--test create
|
||||||
create table CstoreTestTable(id int) with (orientation = column)
|
create table CstoreTestTable(id int) with (orientation = column)
|
||||||
partition by range (id)
|
partition by range (id)
|
||||||
(
|
(
|
||||||
partition CstorePartition1 values less than (5),
|
partition hwcp_CstorePartition1 values less than (5),
|
||||||
partition CstorePartition2 values less than (10)
|
partition hwcp_CstorePartition2 values less than (10)
|
||||||
);
|
);
|
||||||
|
|
||||||
select reloptions from pg_class where relname = 'cstoretesttable';
|
select reloptions from pg_class where relname = 'cstoretesttable';
|
||||||
|
|
||||||
select boundaries from pg_partition where relname = 'cstorepartition1';
|
select boundaries from pg_partition where relname = 'hwcp_cstorepartition1';
|
||||||
|
|
||||||
select boundaries from pg_partition where relname = 'cstorepartition2';
|
select boundaries from pg_partition where relname = 'hwcp_cstorepartition2';
|
||||||
|
|
||||||
--test truncate
|
--test truncate
|
||||||
create table CstorePartition1Col(col int);
|
create table CstorePartition1Col(col int);
|
||||||
@ -22,39 +24,39 @@ create table CstorePartition2CuDescIdxCol(col int);
|
|||||||
create table CstorePartition1DeltaCol(col int);
|
create table CstorePartition1DeltaCol(col int);
|
||||||
create table CstorePartition2DeltaCol(col int);
|
create table CstorePartition2DeltaCol(col int);
|
||||||
|
|
||||||
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition1';
|
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition1';
|
||||||
|
|
||||||
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition2';
|
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition2';
|
||||||
|
|
||||||
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
truncate CstoreTestTable;
|
truncate CstoreTestTable;
|
||||||
|
|
||||||
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition1';
|
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition1';
|
||||||
|
|
||||||
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition2';
|
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition2';
|
||||||
|
|
||||||
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
|
|
||||||
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
|
|
||||||
|
|
||||||
select count(distinct(col)) from CstorePartition1Col;
|
select count(distinct(col)) from CstorePartition1Col;
|
||||||
@ -86,14 +88,14 @@ drop table CstorePartition2DeltaCol;
|
|||||||
|
|
||||||
select * from pg_class where relname = 'cstoretesttable';
|
select * from pg_class where relname = 'cstoretesttable';
|
||||||
|
|
||||||
select * from pg_partition where relname = 'cstorepartition1';
|
select * from pg_partition where relname = 'hwcp_cstorepartition1';
|
||||||
|
|
||||||
select * from pg_partition where relname = 'cstorepartition2';
|
select * from pg_partition where relname = 'hwcp_cstorepartition2';
|
||||||
|
|
||||||
--test for copyfrom partition table
|
--test for copyfrom partition table
|
||||||
|
|
||||||
create schema vector_engine;
|
create schema hwcp_vector_engine;
|
||||||
CREATE TABLE vector_engine.tbl_partition_operator_batch_001(
|
CREATE TABLE hwcp_vector_engine.tbl_partition_operator_batch_001(
|
||||||
C_CHAR_1 CHAR(1),
|
C_CHAR_1 CHAR(1),
|
||||||
C_CHAR_2 CHAR(10),
|
C_CHAR_2 CHAR(10),
|
||||||
C_CHAR_3 CHAR(100),
|
C_CHAR_3 CHAR(100),
|
||||||
@ -158,12 +160,12 @@ CALL PROC_tbl_partition_operator_batch_001_1();
|
|||||||
CALL PROC_tbl_partition_operator_batch_001_1();
|
CALL PROC_tbl_partition_operator_batch_001_1();
|
||||||
CALL PROC_tbl_partition_operator_batch_001_1();
|
CALL PROC_tbl_partition_operator_batch_001_1();
|
||||||
|
|
||||||
insert into vector_engine.tbl_partition_operator_batch_001 select * from row_engine.tbl_partition_operator_batch_001;
|
insert into hwcp_vector_engine.tbl_partition_operator_batch_001 select * from row_engine.tbl_partition_operator_batch_001;
|
||||||
analyze vector_engine.tbl_partition_operator_batch_001;
|
analyze hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
select count(*) from vector_engine.tbl_partition_operator_batch_001;
|
select count(*) from hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
drop table vector_engine.tbl_partition_operator_batch_001;
|
drop table hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
drop table row_engine.tbl_partition_operator_batch_001;
|
drop table row_engine.tbl_partition_operator_batch_001;
|
||||||
drop schema vector_engine;
|
drop schema hwcp_vector_engine;
|
||||||
drop schema row_engine;
|
drop schema row_engine;
|
||||||
|
|
||||||
--test for analyze table with index
|
--test for analyze table with index
|
||||||
@ -202,3 +204,61 @@ drop table test_exchange_partition;
|
|||||||
drop table test_exchange_col;
|
drop table test_exchange_col;
|
||||||
drop table test_exchange_row;
|
drop table test_exchange_row;
|
||||||
|
|
||||||
|
|
||||||
|
-- Insert ... Select 的时候,会判断两分区表的分区属性是否相同
|
||||||
|
create table hwcp_pt1(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition pl values less than (10),
|
||||||
|
partition p2 values less than (100)
|
||||||
|
);
|
||||||
|
create table hwcp_pt2(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (100)
|
||||||
|
);
|
||||||
|
create table hwcp_pt3(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (200)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table hwcp_pt4(a int,b text)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (20)
|
||||||
|
);
|
||||||
|
create table hwcp_pt5(a int,b text)
|
||||||
|
partition by list(a)
|
||||||
|
(
|
||||||
|
partition p1 values (1, 2),
|
||||||
|
partition p2 values (3, 4, 5)
|
||||||
|
);
|
||||||
|
create table hwcp_pt6(a int,b text)
|
||||||
|
partition by hash(a)
|
||||||
|
(
|
||||||
|
partition p1,
|
||||||
|
partition p2
|
||||||
|
);
|
||||||
|
|
||||||
|
insert into hwcp_pt2 values (1, 'hwcp_pt2 p1'),(20,'hwcp_pt2 p2');
|
||||||
|
insert into hwcp_pt3 values (2, 'hwcp_pt3 p1'),(21,'hwcp_pt3 p2');
|
||||||
|
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt2;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt3;
|
||||||
|
select * from hwcp_pt1;
|
||||||
|
|
||||||
|
insert into hwcp_pt4 values (4, 'hwcp_pt4 p1'),(14,'hwcp_pt4 p2');
|
||||||
|
insert into hwcp_pt5 values (1, 'hwcp_pt5 p1'),(5,'hwcp_pt5 p2');
|
||||||
|
insert into hwcp_pt6 values (6, 'hwcp_pt6'),(66,'hwcp_pt6');
|
||||||
|
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt4;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt5;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt6;
|
||||||
|
select * from hwcp_pt1 order by a, b;
|
||||||
|
|
||||||
|
reset search_path;
|
||||||
|
drop schema schema_hw_cstore_partition cascade;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
create schema schema_hw_cstore_partition;
|
||||||
|
set search_path = schema_hw_cstore_partition;
|
||||||
--test create
|
--test create
|
||||||
create table CstoreTestTable(id int) with (orientation = column)
|
create table CstoreTestTable(id int) with (orientation = column)
|
||||||
partition by range (id)
|
partition by range (id)
|
||||||
(
|
(
|
||||||
partition CstorePartition1 values less than (5),
|
partition hwcp_CstorePartition1 values less than (5),
|
||||||
partition CstorePartition2 values less than (10)
|
partition hwcp_CstorePartition2 values less than (10)
|
||||||
);
|
);
|
||||||
select reloptions from pg_class where relname = 'cstoretesttable';
|
select reloptions from pg_class where relname = 'cstoretesttable';
|
||||||
reloptions
|
reloptions
|
||||||
@ -11,13 +13,13 @@ select reloptions from pg_class where relname = 'cstoretesttable';
|
|||||||
{orientation=column,compression=low}
|
{orientation=column,compression=low}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select boundaries from pg_partition where relname = 'cstorepartition1';
|
select boundaries from pg_partition where relname = 'hwcp_cstorepartition1';
|
||||||
boundaries
|
boundaries
|
||||||
------------
|
------------
|
||||||
{5}
|
{5}
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
select boundaries from pg_partition where relname = 'cstorepartition2';
|
select boundaries from pg_partition where relname = 'hwcp_cstorepartition2';
|
||||||
boundaries
|
boundaries
|
||||||
------------
|
------------
|
||||||
{10}
|
{10}
|
||||||
@ -32,23 +34,23 @@ create table CstorePartition1CuDescIdxCol(col int);
|
|||||||
create table CstorePartition2CuDescIdxCol(col int);
|
create table CstorePartition2CuDescIdxCol(col int);
|
||||||
create table CstorePartition1DeltaCol(col int);
|
create table CstorePartition1DeltaCol(col int);
|
||||||
create table CstorePartition2DeltaCol(col int);
|
create table CstorePartition2DeltaCol(col int);
|
||||||
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition1';
|
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition1';
|
||||||
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition2';
|
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition2';
|
||||||
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
truncate CstoreTestTable;
|
truncate CstoreTestTable;
|
||||||
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition1';
|
insert into CstorePartition1Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition1';
|
||||||
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='cstorepartition2';
|
insert into CstorePartition2Col(col) select relfilenode from pg_partition where RELNAME='hwcp_cstorepartition2';
|
||||||
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescCol(col) select relfilenode from pg_class where oid = (select relcudescrelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2CuDescIdxCol(col) select relfilenode from pg_class where oid = (select relcudescidx from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition1');
|
insert into CstorePartition1DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition1');
|
||||||
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'cstorepartition2');
|
insert into CstorePartition2DeltaCol(col) select relfilenode from pg_class where oid = (select reldeltarelid from pg_partition where relname = 'hwcp_cstorepartition2');
|
||||||
select count(distinct(col)) from CstorePartition1Col;
|
select count(distinct(col)) from CstorePartition1Col;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
@ -107,23 +109,23 @@ drop table CstorePartition2CuDescIdxCol;
|
|||||||
drop table CstorePartition1DeltaCol;
|
drop table CstorePartition1DeltaCol;
|
||||||
drop table CstorePartition2DeltaCol;
|
drop table CstorePartition2DeltaCol;
|
||||||
select * from pg_class where relname = 'cstoretesttable';
|
select * from pg_class where relname = 'cstoretesttable';
|
||||||
relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassubclass | relcmprs | relhasclusterkey | relrowmovement | parttype | relfrozenxid | relacl | reloptions | relreplident | relfrozenxid64
|
relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasoids | relhaspkey | relhasrules | relhastriggers | relhassubclass | relcmprs | relhasclusterkey | relrowmovement | parttype | relfrozenxid | relacl | reloptions | relreplident | relfrozenxid64 | relbucket | relbucketkey | relminmxid
|
||||||
---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+----------------+--------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+----------+------------------+----------------+----------+--------------+--------+------------+--------------+----------------
|
---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+----------------+--------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+----------+------------------+----------------+----------+--------------+--------+------------+--------------+----------------+-----------+--------------+------------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
select * from pg_partition where relname = 'cstorepartition1';
|
select * from pg_partition where relname = 'hwcp_cstorepartition1';
|
||||||
relname | parttype | parentid | rangenum | intervalnum | partstrategy | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | indextblid | indisusable | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relfrozenxid | intspnum | partkey | intervaltablespace | interval | boundaries | transit | reloptions | relfrozenxid64
|
relname | parttype | parentid | rangenum | intervalnum | partstrategy | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | indextblid | indisusable | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relfrozenxid | intspnum | partkey | intervaltablespace | interval | boundaries | transit | reloptions | relfrozenxid64 | relminmxid | partkeyexpr | partitionno | subpartitionno
|
||||||
---------+----------+----------+----------+-------------+--------------+-------------+---------------+----------+-----------+---------------+---------------+---------------+------------+-------------+---------------+-------------+----------------+--------------+--------------+----------+---------+--------------------+----------+------------+---------+------------+----------------
|
---------+----------+----------+----------+-------------+--------------+-------------+---------------+----------+-----------+---------------+---------------+---------------+------------+-------------+---------------+-------------+----------------+--------------+--------------+----------+---------+--------------------+----------+------------+---------+------------+----------------+------------+-------------+-------------+----------------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
select * from pg_partition where relname = 'cstorepartition2';
|
select * from pg_partition where relname = 'hwcp_cstorepartition2';
|
||||||
relname | parttype | parentid | rangenum | intervalnum | partstrategy | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | indextblid | indisusable | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relfrozenxid | intspnum | partkey | intervaltablespace | interval | boundaries | transit | reloptions | relfrozenxid64
|
relname | parttype | parentid | rangenum | intervalnum | partstrategy | relfilenode | reltablespace | relpages | reltuples | relallvisible | reltoastrelid | reltoastidxid | indextblid | indisusable | reldeltarelid | reldeltaidx | relcudescrelid | relcudescidx | relfrozenxid | intspnum | partkey | intervaltablespace | interval | boundaries | transit | reloptions | relfrozenxid64 | relminmxid | partkeyexpr | partitionno | subpartitionno
|
||||||
---------+----------+----------+----------+-------------+--------------+-------------+---------------+----------+-----------+---------------+---------------+---------------+------------+-------------+---------------+-------------+----------------+--------------+--------------+----------+---------+--------------------+----------+------------+---------+------------+----------------
|
---------+----------+----------+----------+-------------+--------------+-------------+---------------+----------+-----------+---------------+---------------+---------------+------------+-------------+---------------+-------------+----------------+--------------+--------------+----------+---------+--------------------+----------+------------+---------+------------+----------------+------------+-------------+-------------+----------------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
--test for copyfrom partition table
|
--test for copyfrom partition table
|
||||||
create schema vector_engine;
|
create schema hwcp_vector_engine;
|
||||||
CREATE TABLE vector_engine.tbl_partition_operator_batch_001(
|
CREATE TABLE hwcp_vector_engine.tbl_partition_operator_batch_001(
|
||||||
C_CHAR_1 CHAR(1),
|
C_CHAR_1 CHAR(1),
|
||||||
C_CHAR_2 CHAR(10),
|
C_CHAR_2 CHAR(10),
|
||||||
C_CHAR_3 CHAR(100),
|
C_CHAR_3 CHAR(100),
|
||||||
@ -204,17 +206,17 @@ CALL PROC_tbl_partition_operator_batch_001_1();
|
|||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
insert into vector_engine.tbl_partition_operator_batch_001 select * from row_engine.tbl_partition_operator_batch_001;
|
insert into hwcp_vector_engine.tbl_partition_operator_batch_001 select * from row_engine.tbl_partition_operator_batch_001;
|
||||||
analyze vector_engine.tbl_partition_operator_batch_001;
|
analyze hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
select count(*) from vector_engine.tbl_partition_operator_batch_001;
|
select count(*) from hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
196
|
196
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
drop table vector_engine.tbl_partition_operator_batch_001;
|
drop table hwcp_vector_engine.tbl_partition_operator_batch_001;
|
||||||
drop table row_engine.tbl_partition_operator_batch_001;
|
drop table row_engine.tbl_partition_operator_batch_001;
|
||||||
drop schema vector_engine;
|
drop schema hwcp_vector_engine;
|
||||||
drop schema row_engine;
|
drop schema row_engine;
|
||||||
--test for analyze table with index
|
--test for analyze table with index
|
||||||
create table analyze_table(id int) with (orientation = column);
|
create table analyze_table(id int) with (orientation = column);
|
||||||
@ -257,3 +259,84 @@ select count(1) from test_exchange_partition;
|
|||||||
drop table test_exchange_partition;
|
drop table test_exchange_partition;
|
||||||
drop table test_exchange_col;
|
drop table test_exchange_col;
|
||||||
drop table test_exchange_row;
|
drop table test_exchange_row;
|
||||||
|
-- Insert ... Select 的时候,会判断两分区表的分区属性是否相同
|
||||||
|
create table hwcp_pt1(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition pl values less than (10),
|
||||||
|
partition p2 values less than (100)
|
||||||
|
);
|
||||||
|
create table hwcp_pt2(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (100)
|
||||||
|
);
|
||||||
|
create table hwcp_pt3(a int,b text) with (orientation = column)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (200)
|
||||||
|
);
|
||||||
|
create table hwcp_pt4(a int,b text)
|
||||||
|
partition by range(a)
|
||||||
|
(
|
||||||
|
partition p1 values less than (10),
|
||||||
|
partition p2 values less than (20)
|
||||||
|
);
|
||||||
|
create table hwcp_pt5(a int,b text)
|
||||||
|
partition by list(a)
|
||||||
|
(
|
||||||
|
partition p1 values (1, 2),
|
||||||
|
partition p2 values (3, 4, 5)
|
||||||
|
);
|
||||||
|
create table hwcp_pt6(a int,b text)
|
||||||
|
partition by hash(a)
|
||||||
|
(
|
||||||
|
partition p1,
|
||||||
|
partition p2
|
||||||
|
);
|
||||||
|
insert into hwcp_pt2 values (1, 'hwcp_pt2 p1'),(20,'hwcp_pt2 p2');
|
||||||
|
insert into hwcp_pt3 values (2, 'hwcp_pt3 p1'),(21,'hwcp_pt3 p2');
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt2;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt3;
|
||||||
|
select * from hwcp_pt1;
|
||||||
|
a | b
|
||||||
|
----+-------------
|
||||||
|
1 | hwcp_pt2 p1
|
||||||
|
2 | hwcp_pt3 p1
|
||||||
|
20 | hwcp_pt2 p2
|
||||||
|
21 | hwcp_pt3 p2
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
|
insert into hwcp_pt4 values (4, 'hwcp_pt4 p1'),(14,'hwcp_pt4 p2');
|
||||||
|
insert into hwcp_pt5 values (1, 'hwcp_pt5 p1'),(5,'hwcp_pt5 p2');
|
||||||
|
insert into hwcp_pt6 values (6, 'hwcp_pt6'),(66,'hwcp_pt6');
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt4;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt5;
|
||||||
|
insert into hwcp_pt1 select * from hwcp_pt6;
|
||||||
|
select * from hwcp_pt1 order by a, b;
|
||||||
|
a | b
|
||||||
|
----+-------------
|
||||||
|
1 | hwcp_pt2 p1
|
||||||
|
1 | hwcp_pt5 p1
|
||||||
|
2 | hwcp_pt3 p1
|
||||||
|
4 | hwcp_pt4 p1
|
||||||
|
5 | hwcp_pt5 p2
|
||||||
|
6 | hwcp_pt6
|
||||||
|
14 | hwcp_pt4 p2
|
||||||
|
20 | hwcp_pt2 p2
|
||||||
|
21 | hwcp_pt3 p2
|
||||||
|
66 | hwcp_pt6
|
||||||
|
(10 rows)
|
||||||
|
|
||||||
|
reset search_path;
|
||||||
|
drop schema schema_hw_cstore_partition cascade;
|
||||||
|
NOTICE: drop cascades to 7 other objects
|
||||||
|
DETAIL: drop cascades to function schema_hw_cstore_partition.proc_tbl_partition_operator_batch_001_1()
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt1
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt2
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt3
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt4
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt5
|
||||||
|
drop cascades to table schema_hw_cstore_partition.hwcp_pt6
|
||||||
|
@ -554,7 +554,7 @@ test: xc_dml
|
|||||||
|
|
||||||
test: hw_cstore_tablespace hw_cstore_truncate hw_cstore_update
|
test: hw_cstore_tablespace hw_cstore_truncate hw_cstore_update
|
||||||
#test: hw_cstore_roughcheck
|
#test: hw_cstore_roughcheck
|
||||||
test: hw_cstore_partition_update hw_cstore_partition_update1 hw_cstore_partition_update2
|
test: hw_cstore_partition_update hw_cstore_partition_update1 hw_cstore_partition_update2 hw_cstore_partition
|
||||||
|
|
||||||
#------------------------------
|
#------------------------------
|
||||||
# CStore compression test cases
|
# CStore compression test cases
|
||||||
|
Reference in New Issue
Block a user