提交 2479d566 编写于 作者: T Taylor Vesely 提交者: David Krieger

Fix failing tests after implementing recursive index drop

This commit is part of Add Partitioned Indexes #7047.

After adding INTERNAL_AUTO, and dependencies between partitioned indexs,
many tests that assumed that we need to manually delete indexes added to
leaf partitions need updating.
Co-authored-by: NKalen Krempely <kkrempely@pivotal.io>
上级 a3d17a98
......@@ -23,13 +23,13 @@ RESET gp_allow_rename_relation_without_lock;
-- MPP-20466 Dis-allow duplicate constraint names for same table
create table dupconstr (
i int,
j int constraint test CHECK (j > 10))
j int constraint dup_constraint CHECK (j > 10))
distributed by (i);
-- should fail because of duplicate constraint name
alter table dupconstr add constraint test unique (i);
ERROR: constraint "test" for relation "dupconstr" already exists
alter table dupconstr add constraint test primary key (i);
ERROR: constraint "test" for relation "dupconstr" already exists
alter table dupconstr add constraint dup_constraint unique (i);
ERROR: constraint "dup_constraint" for relation "dupconstr" already exists
alter table dupconstr add constraint dup_constraint primary key (i);
ERROR: constraint "dup_constraint" for relation "dupconstr" already exists
-- cleanup
drop table dupconstr;
--
......
......@@ -511,8 +511,6 @@ select a, count(*) from pt where a<2 group by a;
-- CLEANUP
drop index pt_c;
WARNING: only dropped the index "pt_c"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists pt;
drop table if exists t;
--
......
......@@ -177,11 +177,7 @@ select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp218
-- CLEANUP
drop index index_2;
WARNING: only dropped the index "index_2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index index_1;
WARNING: only dropped the index "index_1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists mpp21834_t2;
drop table if exists mpp21834_t1;
reset optimizer_enable_hashjoin;
......@@ -709,11 +705,7 @@ select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = 'hello0';
-- CLEANUP
drop index ptid_idx;
WARNING: only dropped the index "ptid_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index pt1_idx;
WARNING: only dropped the index "pt1_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists mpp24151_t;
drop table if exists mpp24151_pt;
reset optimizer_enable_dynamictablescan;
......@@ -970,12 +962,8 @@ select * from dbs where c2= 15 and c3 = 5;
-- CLEANUP
drop index dbs_index;
WARNING: only dropped the index "dbs_index"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists dbs;
drop index dis_index;
WARNING: only dropped the index "dis_index"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists dis;
drop table if exists dts;
reset optimizer_enable_dynamictablescan;
......
......@@ -176,11 +176,7 @@ select find_operator('analyze select * from mpp21834_t2,mpp21834_t1 where mpp218
-- CLEANUP
drop index index_2;
WARNING: only dropped the index "index_2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index index_1;
WARNING: only dropped the index "index_1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists mpp21834_t2;
drop table if exists mpp21834_t1;
reset optimizer_enable_hashjoin;
......@@ -708,11 +704,7 @@ select * from mpp24151_t, mpp24151_pt where tid = ptid and pt1 = 'hello0';
-- CLEANUP
drop index ptid_idx;
WARNING: only dropped the index "ptid_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index pt1_idx;
WARNING: only dropped the index "pt1_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists mpp24151_t;
drop table if exists mpp24151_pt;
reset optimizer_enable_dynamictablescan;
......@@ -969,12 +961,8 @@ select * from dbs where c2= 15 and c3 = 5;
-- CLEANUP
drop index dbs_index;
WARNING: only dropped the index "dbs_index"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists dbs;
drop index dis_index;
WARNING: only dropped the index "dis_index"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop table if exists dis;
drop table if exists dts;
reset optimizer_enable_dynamictablescan;
......
......@@ -9882,11 +9882,7 @@ select sum(i) i_sum, sum(j) j_sum, sum(t::integer) t_sum from bm.het_bm where i=
-- Drop and recreate index after we dropped column
drop index bm.het_bm_i_idx;
WARNING: only dropped the index "het_bm_i_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index bm.het_bm_j_idx;
WARNING: only dropped the index "het_bm_j_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
create index het_bm_i_idx on bm.het_bm using bitmap (i);
NOTICE: building index for child partition "het_bm_1_prt_part0"
NOTICE: building index for child partition "het_bm_1_prt_part1"
......
......@@ -9914,11 +9914,7 @@ select sum(i) i_sum, sum(j) j_sum, sum(t::integer) t_sum from bm.het_bm where i=
-- Drop and recreate index after we dropped column
drop index bm.het_bm_i_idx;
WARNING: only dropped the index "het_bm_i_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index bm.het_bm_j_idx;
WARNING: only dropped the index "het_bm_j_idx"
HINT: To drop other indexes on child partitions, drop each one explicitly.
create index het_bm_i_idx on bm.het_bm using bitmap (i);
NOTICE: building index for child partition "het_bm_1_prt_part0"
NOTICE: building index for child partition "het_bm_1_prt_part1"
......
......@@ -2636,7 +2636,7 @@ drop table foo;
-- created tables due to split.
drop table mpp14613_list;
--
-- Drop index on a partitioned table. The indexes on the partitions remain.
-- Drop index on a partitioned table. The indexes on the partitions are removed.
--
create table pt_indx_tab (c1 integer, c2 int, c3 text) partition by range (c1) (partition A start (integer '0') end (integer '5') every (integer '1'));
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1' as the Greenplum Database data distribution key for this table.
......@@ -2665,8 +2665,6 @@ select count(*) from pg_index where indrelid='pt_indx_tab_1_prt_a_1'::regclass;
(1 row)
drop index pt_indx_drop;
WARNING: only dropped the index "pt_indx_drop"
HINT: To drop other indexes on child partitions, drop each one explicitly.
select count(*) from pg_index where indrelid='pt_indx_tab'::regclass;
count
-------
......@@ -2676,7 +2674,7 @@ select count(*) from pg_index where indrelid='pt_indx_tab'::regclass;
select count(*) from pg_index where indrelid='pt_indx_tab_1_prt_a_1'::regclass;
count
-------
1
0
(1 row)
--
......@@ -2786,33 +2784,24 @@ select * from pg_indexes where tablename like 'mpp7635%';
public | mpp7635_aoi_table2_1_prt_2 | mpp7635_aoi_table2_1_prt_2_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_2_id_idx ON public.mpp7635_aoi_table2_1_prt_2 USING bitmap (id)
(3 rows)
-- Drop it. This only drops it from the root table, not the partitions.
-- Drop it
DROP INDEX mpp7635_ix3;
WARNING: only dropped the index "mpp7635_ix3"
HINT: To drop other indexes on child partitions, drop each one explicitly.
select * from pg_indexes where tablename like 'mpp7635%';
schemaname | tablename | indexname | tablespace | indexdef
------------+----------------------------+-----------------------------------+------------+-------------------------------------------------------------------------------------------------------
public | mpp7635_aoi_table2_1_prt_1 | mpp7635_aoi_table2_1_prt_1_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_1_id_idx ON public.mpp7635_aoi_table2_1_prt_1 USING bitmap (id)
public | mpp7635_aoi_table2_1_prt_2 | mpp7635_aoi_table2_1_prt_2_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_2_id_idx ON public.mpp7635_aoi_table2_1_prt_2 USING bitmap (id)
(2 rows)
schemaname | tablename | indexname | tablespace | indexdef
------------+-----------+-----------+------------+----------
(0 rows)
-- Create it again. This creates the index on the partitions, too, so you
-- end up with duplicate indexes on the partitions. It's a bit silly, but
-- should still work, and not throw a "relation already exists" error, for
-- example.
-- Create it again.
CREATE INDEX mpp7635_ix3 ON mpp7635_aoi_table2 (id);
NOTICE: building index for child partition "mpp7635_aoi_table2_1_prt_1"
NOTICE: building index for child partition "mpp7635_aoi_table2_1_prt_2"
select * from pg_indexes where tablename like 'mpp7635%';
schemaname | tablename | indexname | tablespace | indexdef
------------+----------------------------+------------------------------------+------------+-------------------------------------------------------------------------------------------------------
public | mpp7635_aoi_table2_1_prt_1 | mpp7635_aoi_table2_1_prt_1_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_1_id_idx ON public.mpp7635_aoi_table2_1_prt_1 USING bitmap (id)
public | mpp7635_aoi_table2_1_prt_2 | mpp7635_aoi_table2_1_prt_2_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_2_id_idx ON public.mpp7635_aoi_table2_1_prt_2 USING bitmap (id)
public | mpp7635_aoi_table2 | mpp7635_ix3 | | CREATE INDEX mpp7635_ix3 ON public.mpp7635_aoi_table2 USING btree (id)
public | mpp7635_aoi_table2_1_prt_1 | mpp7635_aoi_table2_1_prt_1_id_idx1 | | CREATE INDEX mpp7635_aoi_table2_1_prt_1_id_idx1 ON public.mpp7635_aoi_table2_1_prt_1 USING btree (id)
public | mpp7635_aoi_table2_1_prt_2 | mpp7635_aoi_table2_1_prt_2_id_idx1 | | CREATE INDEX mpp7635_aoi_table2_1_prt_2_id_idx1 ON public.mpp7635_aoi_table2_1_prt_2 USING btree (id)
(5 rows)
schemaname | tablename | indexname | tablespace | indexdef
------------+----------------------------+-----------------------------------+------------+------------------------------------------------------------------------------------------------------
public | mpp7635_aoi_table2 | mpp7635_ix3 | | CREATE INDEX mpp7635_ix3 ON public.mpp7635_aoi_table2 USING btree (id)
public | mpp7635_aoi_table2_1_prt_1 | mpp7635_aoi_table2_1_prt_1_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_1_id_idx ON public.mpp7635_aoi_table2_1_prt_1 USING btree (id)
public | mpp7635_aoi_table2_1_prt_2 | mpp7635_aoi_table2_1_prt_2_id_idx | | CREATE INDEX mpp7635_aoi_table2_1_prt_2_id_idx ON public.mpp7635_aoi_table2_1_prt_2 USING btree (id)
(3 rows)
--
-- Test handling of NULL values in SPLIT PARTITION.
......
......@@ -140,29 +140,13 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
WARNING: only dropped the index "mpp3033a_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_hundred;
WARNING: only dropped the index "mpp3033a_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_stringu1;
WARNING: only dropped the index "mpp3033a_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
WARNING: only dropped the index "mpp3033b_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_hundred;
WARNING: only dropped the index "mpp3033b_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_stringu1;
WARNING: only dropped the index "mpp3033b_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
CREATE INDEX mpp3033a_unique1 ON mpp3033a (unique1);
NOTICE: building index for child partition "mpp3033a_1_prt_aa"
NOTICE: building index for child partition "mpp3033a_1_prt_bb"
......@@ -240,29 +224,13 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
WARNING: only dropped the index "mpp3033a_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_hundred;
WARNING: only dropped the index "mpp3033a_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_stringu1;
WARNING: only dropped the index "mpp3033a_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
WARNING: only dropped the index "mpp3033b_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_hundred;
WARNING: only dropped the index "mpp3033b_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_stringu1;
WARNING: only dropped the index "mpp3033b_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
CREATE UNIQUE INDEX mpp3033a_unique1 ON mpp3033a (unique1);
NOTICE: building index for child partition "mpp3033a_1_prt_aa"
NOTICE: building index for child partition "mpp3033a_1_prt_bb"
......@@ -346,8 +314,6 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
ERROR: index "mpp3033a_unique2" does not exist
drop index mpp3033a_hundred;
......@@ -355,8 +321,6 @@ ERROR: index "mpp3033a_hundred" does not exist
drop index mpp3033a_stringu1;
ERROR: index "mpp3033a_stringu1" does not exist
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
ERROR: index "mpp3033b_unique2" does not exist
drop index mpp3033b_hundred;
......@@ -687,29 +651,13 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
WARNING: only dropped the index "mpp3033a_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_hundred;
WARNING: only dropped the index "mpp3033a_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_stringu1;
WARNING: only dropped the index "mpp3033a_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
WARNING: only dropped the index "mpp3033b_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_hundred;
WARNING: only dropped the index "mpp3033b_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_stringu1;
WARNING: only dropped the index "mpp3033b_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
CREATE INDEX mpp3033a_unique1 ON mpp3033a (unique1);
NOTICE: building index for child partition "mpp3033a_1_prt_default_part"
NOTICE: building index for child partition "mpp3033a_1_prt_aa_1"
......@@ -867,29 +815,13 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
WARNING: only dropped the index "mpp3033a_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_hundred;
WARNING: only dropped the index "mpp3033a_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_stringu1;
WARNING: only dropped the index "mpp3033a_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
WARNING: only dropped the index "mpp3033b_unique2"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_hundred;
WARNING: only dropped the index "mpp3033b_hundred"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_stringu1;
WARNING: only dropped the index "mpp3033b_stringu1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
CREATE UNIQUE INDEX mpp3033a_unique1 ON mpp3033a (unique1);
NOTICE: building index for child partition "mpp3033a_1_prt_default_part"
NOTICE: building index for child partition "mpp3033a_1_prt_aa_1"
......@@ -1059,8 +991,6 @@ select count(*) from mpp3033b;
(1 row)
drop index mpp3033a_unique1;
WARNING: only dropped the index "mpp3033a_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033a_unique2;
ERROR: index "mpp3033a_unique2" does not exist
drop index mpp3033a_hundred;
......@@ -1068,8 +998,6 @@ ERROR: index "mpp3033a_hundred" does not exist
drop index mpp3033a_stringu1;
ERROR: index "mpp3033a_stringu1" does not exist
drop index mpp3033b_unique1;
WARNING: only dropped the index "mpp3033b_unique1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
drop index mpp3033b_unique2;
ERROR: index "mpp3033b_unique2" does not exist
drop index mpp3033b_hundred;
......
......@@ -404,14 +404,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col1 between 10 AND 25 ORDER BY col2,col3
(22 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col1_idx;
-- @description B-tree single index key = partitioning key
CREATE INDEX idx1 on pt_lt_tab(col2);
NOTICE: building index for child partition "pt_lt_tab_1_prt_part1"
......@@ -648,8 +640,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3
(26 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- @description multiple column b-tree index
CREATE INDEX idx1 on pt_lt_tab(col1,col2);
NOTICE: building index for child partition "pt_lt_tab_1_prt_part1"
......@@ -735,8 +725,8 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 = 25 ORDER BY col2,col3 LIMIT 5;
-> Limit (cost=1100.16..1100.17 rows=1 width=12)
-> Sort (cost=1100.16..1100.17 rows=1 width=12)
Sort Key: pt_lt_tab_1_prt_part3.col3
-> Append (cost=0.14..1100.15 rows=1 width=12)
-> Index Scan using pt_lt_tab_1_prt_part3_col2_idx on pt_lt_tab_1_prt_part3 (cost=0.14..1100.15 rows=1 width=12)
-> Append (cost=0.14..10100.22 rows=1 width=12)
-> Index Scan using pt_lt_tab_1_prt_part3_col1_col2_idx on pt_lt_tab_1_prt_part3 (cost=0.14..10100.22 rows=1 width=12)
Index Cond: (col2 = 25::numeric)
Optimizer: legacy query optimizer
(10 rows)
......@@ -819,11 +809,11 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 > 10.00 OR col1 = 50 ORDER BY col2,co
-> Limit (cost=46115.01..46115.02 rows=2 width=12)
-> Sort (cost=46115.01..46115.11 rows=14 width=12)
Sort Key: pt_lt_tab_1_prt_part1.col2, pt_lt_tab_1_prt_part1.col3
-> Append (cost=2000.29..46114.33 rows=14 width=12)
-> Bitmap Heap Scan on pt_lt_tab_1_prt_part1 (cost=2000.29..2100.30 rows=1 width=12)
Recheck Cond: col2 > 10.00 OR col1 = 50
-> BitmapOr (cost=2000.29..2000.29 rows=1 width=0)
-> Bitmap Index Scan on pt_lt_tab_1_prt_part1_col2_idx (cost=0.00..1000.14 rows=1 width=0)
-> Append (cost=11000.35..55114.40 rows=14 width=12)
-> Bitmap Heap Scan on pt_lt_tab_1_prt_part1 (cost=11000.35..11100.37 rows=1 width=12)
Recheck Cond: ((col2 > 10.00) OR (col1 = 50))
-> BitmapOr (cost=11000.35..11000.35 rows=1 width=0)
-> Bitmap Index Scan on pt_lt_tab_1_prt_part1_col1_col2_idx (cost=0.00..10000.21 rows=1 width=0)
Index Cond: (col2 > 10.00)
-> Bitmap Index Scan on pt_lt_tab_1_prt_part1_col1_col2_idx (cost=0.00..1000.14 rows=1 width=0)
Index Cond: (col1 = 50)
......@@ -877,8 +867,8 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3
-> Limit (cost=41114.39..41114.40 rows=2 width=12)
-> Sort (cost=41114.39..41114.49 rows=14 width=12)
Sort Key: pt_lt_tab_1_prt_part1.col2, pt_lt_tab_1_prt_part1.col3
-> Append (cost=0.14..41113.70 rows=14 width=12)
-> Index Scan using pt_lt_tab_1_prt_part1_col2_idx on pt_lt_tab_1_prt_part1 (cost=0.14..1100.15 rows=1 width=12)
-> Append (cost=0.14..50113.79 rows=14 width=12)
-> Index Scan using pt_lt_tab_1_prt_part1_col1_col2_idx on pt_lt_tab_1_prt_part1 (cost=0.14..10100.25 rows=1 width=12)
Index Cond: ((col2 >= 10::numeric) AND (col2 <= 50::numeric))
-> Bitmap Heap Scan on pt_lt_tab_1_prt_part2 (cost=10000.24..10003.39 rows=4 width=12)
Recheck Cond: ((col2 >= 10::numeric) AND (col2 <= 50::numeric))
......@@ -900,14 +890,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3
(26 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col2_idx;
-- @description multi-column unique constraint (= b-tree index). Essentially the
-- same as the previous case, but the columns are the other way 'round, and we
-- do this on the table with default partition.
......
......@@ -333,14 +333,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col1 between 10 AND 25 ORDER BY col2,col3
(13 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col1_idx;
-- @description B-tree single index key = partitioning key
CREATE INDEX idx1 on pt_lt_tab(col2);
NOTICE: building index for child partition "pt_lt_tab_1_prt_part1"
......@@ -541,8 +533,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3
(14 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- @description multiple column b-tree index
CREATE INDEX idx1 on pt_lt_tab(col1,col2);
NOTICE: building index for child partition "pt_lt_tab_1_prt_part1"
......@@ -734,14 +724,6 @@ EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3
(14 rows)
DROP INDEX idx1;
WARNING: only dropped the index "idx1"
HINT: To drop other indexes on child partitions, drop each one explicitly.
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col2_idx;
-- @description multi-column unique constraint (= b-tree index). Essentially the
-- same as the previous case, but the columns are the other way 'round, and we
-- do this on the table with default partition.
......
......@@ -778,8 +778,6 @@ INFO: (slice 0) Dispatch command to SINGLE content
INFO: Distributed transaction command 'Distributed Prepare' to SINGLE content
INFO: Distributed transaction command 'Distributed Commit Prepared' to SINGLE content
DROP INDEX id3;
WARNING: only dropped the index "id3"
HINT: To drop other indexes on child partitions, drop each one explicitly.
INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2
INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2
CREATE INDEX id3 ON range_table USING BITMAP (id);
......
......@@ -764,8 +764,6 @@ INFO: (slice 0) Dispatch command to SINGLE content
INFO: Distributed transaction command 'Distributed Prepare' to SINGLE content
INFO: Distributed transaction command 'Distributed Commit Prepared' to SINGLE content
DROP INDEX id3;
WARNING: only dropped the index "id3"
HINT: To drop other indexes on child partitions, drop each one explicitly.
INFO: Distributed transaction command 'Distributed Prepare' to ALL contents: 0 1 2
INFO: Distributed transaction command 'Distributed Commit Prepared' to ALL contents: 0 1 2
CREATE INDEX id3 ON range_table USING BITMAP (id);
......
......@@ -23,11 +23,11 @@ RESET gp_allow_rename_relation_without_lock;
-- MPP-20466 Dis-allow duplicate constraint names for same table
create table dupconstr (
i int,
j int constraint test CHECK (j > 10))
j int constraint dup_constraint CHECK (j > 10))
distributed by (i);
-- should fail because of duplicate constraint name
alter table dupconstr add constraint test unique (i);
alter table dupconstr add constraint test primary key (i);
alter table dupconstr add constraint dup_constraint unique (i);
alter table dupconstr add constraint dup_constraint primary key (i);
-- cleanup
drop table dupconstr;
......
......@@ -1297,7 +1297,7 @@ drop table foo;
drop table mpp14613_list;
--
-- Drop index on a partitioned table. The indexes on the partitions remain.
-- Drop index on a partitioned table. The indexes on the partitions are removed.
--
create table pt_indx_tab (c1 integer, c2 int, c3 text) partition by range (c1) (partition A start (integer '0') end (integer '5') every (integer '1'));
......@@ -1397,14 +1397,11 @@ INSERT INTO mpp7635_aoi_table2(id) VALUES (0);
CREATE INDEX mpp7635_ix3 ON mpp7635_aoi_table2 USING BITMAP (id);
select * from pg_indexes where tablename like 'mpp7635%';
-- Drop it. This only drops it from the root table, not the partitions.
-- Drop it
DROP INDEX mpp7635_ix3;
select * from pg_indexes where tablename like 'mpp7635%';
-- Create it again. This creates the index on the partitions, too, so you
-- end up with duplicate indexes on the partitions. It's a bit silly, but
-- should still work, and not throw a "relation already exists" error, for
-- example.
-- Create it again.
CREATE INDEX mpp7635_ix3 ON mpp7635_aoi_table2 (id);
select * from pg_indexes where tablename like 'mpp7635%';
......
......@@ -148,12 +148,6 @@ SELECT * FROM pt_lt_tab WHERE col1 between 10 AND 25 ORDER BY col2,col3 LIMIT 5;
EXPLAIN SELECT * FROM pt_lt_tab WHERE col1 between 10 AND 25 ORDER BY col2,col3 LIMIT 5;
DROP INDEX idx1;
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col1_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col1_idx;
-- @description B-tree single index key = partitioning key
CREATE INDEX idx1 on pt_lt_tab(col2);
......@@ -195,14 +189,6 @@ SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3 LIMIT 5;
EXPLAIN SELECT * FROM pt_lt_tab WHERE col2 between 10 AND 50 ORDER BY col2,col3 LIMIT 5;
DROP INDEX idx1;
-- have to drop the indexes on the partitions explicitly.
DROP INDEX pt_lt_tab_1_prt_part1_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part2_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part3_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part4_col2_idx;
DROP INDEX pt_lt_tab_1_prt_part5_col2_idx;
-- @description multi-column unique constraint (= b-tree index). Essentially the
-- same as the previous case, but the columns are the other way 'round, and we
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册