提交 adf3ed40 编写于 作者: J Jimmy Yih 提交者: Xin Zhang

Fix TINC storage tests after introducing relfilenode counter change.

A lot of tests assumed OID == relfilenode. We updated the tests to not assume
that anymore.
上级 974e78dc
......@@ -17,25 +17,25 @@ CREATE INDEX
create index co_i1 on co_t1(a);
CREATE INDEX
--Verify that the indexes have unique and primary key constraints on them
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select relfilenode from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select oid from pg_class where relname = 'ao_t1') || '_index');
indisunique | indisprimary
-------------+--------------
t | t
(1 row)
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select relfilenode from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select oid from pg_class where relname = 'ao_t1') || '_index');
indisunique | indisprimary
-------------+--------------
t | t
(1 row)
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select relfilenode from pg_class where relname = 'co_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select oid from pg_class where relname = 'co_t1') || '_index');
indisunique | indisprimary
-------------+--------------
t | t
(1 row)
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select relfilenode from pg_class where relname = 'co_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select oid from pg_class where relname = 'co_t1') || '_index');
indisunique | indisprimary
-------------+--------------
t | t
......
......@@ -8,7 +8,7 @@ create index ao_i1 on ao_t1(a);
create index co_i1 on co_t1(a);
--Verify that the indexes have unique and primary key constraints on them
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select relfilenode from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select relfilenode from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select relfilenode from pg_class where relname = 'co_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select relfilenode from pg_class where relname = 'co_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select oid from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select oid from pg_class where relname = 'ao_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aovisimap_' || (select oid from pg_class where relname = 'co_t1') || '_index');
select indisunique, indisprimary from pg_index where indexrelid = (select oid from pg_class where relname = 'pg_aoblkdir_' || (select oid from pg_class where relname = 'co_t1') || '_index');
......@@ -3,7 +3,7 @@ SET
--pgaocsseg has more entries than gp_relation_node
begin;
BEGIN
insert into pg_aoseg.pg_aocsseg_17608 values(5, 6, 7, '0'::bytea, 1, 1);
insert into pg_aoseg.pg_aocsseg_17608 values(5, 6, 7, '0'::bytea, 1, 1, 1);
INSERT 0 1
select * from co1;
psql:/path/sql_file:1: ERROR: Index 0 exceed size of vpinfo array size 0 (aocssegfiles.h:116)
......
......@@ -2,19 +2,19 @@ set allow_system_table_mods='DML';
--pgaocsseg has more entries than gp_relation_node
begin;
insert into pg_aoseg.pg_aocsseg_<relfilenode_oid> values(5, 6, 7, '0'::bytea, 1, 1);
insert into pg_aoseg.pg_aocsseg_<oid> values(5, 6, 7, '0'::bytea, 1, 1, 1);
select * from co1;
abort;
--pgaocsseg has less entries than gp_relation_node
begin;
delete from pg_aoseg.pg_aocsseg_<relfilenode_oid>;
delete from pg_aoseg.pg_aocsseg_<oid>;
select * from co1;
abort;
--pgaocsseg has same number of entries but mistmatch with gp_relation_node
begin;
update pg_aoseg.pg_aocsseg_<relfilenode_oid> set segno = 3 where segno = 1;
update pg_aoseg.pg_aocsseg_<oid> set segno = 3 where segno = 1;
select * from co1;
abort;
......
......@@ -2,19 +2,19 @@ set allow_system_table_mods='DML';
--pgaoseg has more entries than gp_relation_node
begin;
insert into pg_aoseg.pg_aoseg_<relfilenode_oid> values(5, 6, 7, 8, 9, 10, 11, 12);
insert into pg_aoseg.pg_aoseg_<oid> values(5, 6, 7, 8, 9, 10, 11, 12);
select * from ao1;
abort;
--pgaoseg has less entries than gp_relation_node
begin;
delete from pg_aoseg.pg_aoseg_<relfilenode_oid>;
delete from pg_aoseg.pg_aoseg_<oid>;
select * from ao1;
abort;
--pgaoseg has same number of entries but mismatch with gp_relation_node
begin;
update pg_aoseg.pg_aoseg_<relfilenode_oid> set segno = 3 where segno = 1;
update pg_aoseg.pg_aoseg_<oid> set segno = 3 where segno = 1;
select * from ao1;
abort;
......
......@@ -52,23 +52,23 @@ class AppendOnlyReadCheckTests(MPPTestCase):
if not Gpdiff.are_files_equal(out_file, ans_file):
raise Exception('Unable to create tables')
def get_relfilenode_oid(self, tablename):
RELFILENODE_OID_QUERY = """ SELECT relfilenode
def get_oid(self, tablename):
OID_QUERY = """ SELECT oid
FROM pg_class
WHERE relname='%s'
""" % tablename
with dbconn.connect(dbconn.DbURL()) as conn:
relfilenode_oid = dbconn.execSQLForSingleton(conn, RELFILENODE_OID_QUERY)
return relfilenode_oid
oid = dbconn.execSQLForSingleton(conn, OID_QUERY)
return oid
def transform_sql_file(self, sql_file, tablename):
relfilenode_oid = self.get_relfilenode_oid(tablename)
oid = self.get_oid(tablename)
new_sql_file = sql_file.strip('.t')
with open(new_sql_file, 'w') as fp1:
with open(sql_file, 'r') as fp2:
for line in fp2:
if '<relfilenode_oid>' in line:
line = line.replace('<relfilenode_oid>', str(relfilenode_oid))
if '<oid>' in line:
line = line.replace('<oid>', str(oid))
fp1.write(line)
def test_pg_aoseg_corruption(self):
......
......@@ -10,7 +10,7 @@ Create table dsp_ck_1 ( i int, j int);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
relstorage | reloptions | checksum
------------+-------------------+----------
a | {appendonly=true} | t
......@@ -25,7 +25,7 @@ Create table dsp_ck_1 ( i int, j int);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
relstorage | reloptions | checksum
------------+----------------------------------+----------
a | {appendonly=true,checksum=false} | f
......@@ -42,7 +42,7 @@ Create table dsp_ck_1 ( i int, j int);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
relstorage | reloptions | checksum
------------+-------------------+----------
a | {appendonly=true} | t
......@@ -59,7 +59,7 @@ Create table dsp_ck_1 ( i int, j int) with (checksum=false);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
relstorage | reloptions | checksum
------------+----------------------------------+----------
a | {checksum=false,appendonly=true} | f
......
......@@ -217,7 +217,7 @@ Has OIDs: no
Options: appendonly=true
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='temp_ds_t1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='temp_ds_t1';
relstorage | reloptions | checksum
------------+-------------------+----------
a | {appendonly=true} | t
......
......@@ -360,7 +360,7 @@ Has OIDs: no
Options: orientation=column, compresslevel=1, checksum=true, appendonly=true
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_db_ct_t5';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_db_ct_t5';
relstorage | reloptions | checksum
------------+--------------------------------------------------------------------+----------
c | {orientation=column,compresslevel=1,checksum=true,appendonly=true} | t
......
......@@ -172,7 +172,7 @@ Has OIDs: no
Options: checksum=false, appendonly=true
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_rl_ck_t3';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_rl_ck_t3';
relstorage | reloptions | checksum
------------+----------------------------------+----------
a | {checksum=false,appendonly=true} | f
......
......@@ -390,7 +390,7 @@ Has OIDs: no
Options: checksum=false, appendonly=true
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_ck_t3';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_ck_t3';
relstorage | reloptions | checksum
------------+----------------------------------+----------
a | {checksum=false,appendonly=true} | f
......@@ -449,7 +449,7 @@ Has OIDs: no
Options: orientation=column, appendonly=true, checksum=false
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_ck_t6';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_ck_t6';
relstorage | reloptions | checksum
------------+-----------------------------------------------------+----------
c | {orientation=column,appendonly=true,checksum=false} | f
......
......@@ -295,7 +295,7 @@ Has OIDs: no
Options: orientation=column, checksum=true, appendonly=true, compresstype=zlib
Distributed by: (i)
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_cl_t5';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_cl_t5';
relstorage | reloptions | checksum
------------+----------------------------------------------------------------------+----------
c | {orientation=column,checksum=true,appendonly=true,compresstype=zlib} | t
......
......@@ -6,7 +6,7 @@
\c dsp_db1
Drop table if exists dsp_ck_1;
Create table dsp_ck_1 ( i int, j int);
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
Drop table dsp_ck_1;
......@@ -14,7 +14,7 @@ Drop table dsp_ck_1;
\c dsp_db1 dsp_role1
Create table dsp_ck_1 ( i int, j int);
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
Drop table dsp_ck_1;
-- Database - checksum=true ; Role - checksum=false, Session - checksum=true
......@@ -22,7 +22,7 @@ Drop table dsp_ck_1;
\c dsp_db1 dsp_role1
SET gp_default_storage_options='appendonly=true, checksum=true';
Create table dsp_ck_1 ( i int, j int);
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
Drop table dsp_ck_1;
......@@ -31,5 +31,5 @@ Drop table dsp_ck_1;
\c dsp_db1 dsp_role1
SET gp_default_storage_options='appendonly=true, checksum=true';
Create table dsp_ck_1 ( i int, j int) with (checksum=false);
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='dsp_ck_1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='dsp_ck_1';
Drop table dsp_ck_1;
......@@ -95,7 +95,7 @@ Drop table ao_db_ap_t5;
Create temp table temp_ds_t1 ( i int, j int);
\d+ temp_ds_t1
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='temp_ds_t1';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='temp_ds_t1';
Drop table temp_ds_t1;
......
......@@ -153,7 +153,7 @@ Select count(*) from ao_db_ct_t5;
\d+ ao_db_ct_t5
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_db_ct_t5';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_db_ct_t5';
Drop table ao_db_ct_t5;
......
......@@ -75,7 +75,7 @@ Select count(*) from ao_rl_ck_t3;
\d+ ao_rl_ck_t3;
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_rl_ck_t3';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_rl_ck_t3';
Drop table ao_rl_ck_t3;
......
......@@ -152,7 +152,7 @@ Select count(*) from ao_ss_ck_t3;
\d+ ao_ss_ck_t3;
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_ck_t3';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_ck_t3';
Drop table ao_ss_ck_t3;
......@@ -179,7 +179,7 @@ Insert into ao_ss_ck_t6 select i, i+1 from generate_series(1,10) i;
Select count(*) from ao_ss_ck_t6;
\d+ ao_ss_ck_t6;
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_ck_t6';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_ck_t6';
Alter table ao_ss_ck_t6 add column k int default 2 encoding(compresstype=quicklz,blocksize=8192);
......
......@@ -122,7 +122,7 @@ Select count(*) from ao_ss_cl_t5;
\d+ ao_ss_cl_t5
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.relfilenode=a.relid and c.relname='ao_ss_cl_t5';
select relstorage, reloptions,checksum from pg_class c , pg_appendonly a where c.oid=a.relid and c.relname='ao_ss_cl_t5';
select compresslevel, compresstype, blocksize, checksum, columnstore from pg_appendonly where relid = (select oid from pg_class where relname='ao_ss_cl_t5');
Drop table ao_ss_cl_t5;
......
......@@ -57,7 +57,7 @@ ALTER TABLE
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_1_prt_mno" for table "pt_heap_tab"
ALTER TABLE
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_1_prt_xyz', 'pt_heap_tab_1_prt_jkl','pt_heap_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_1_prt_xyz', 'pt_heap_tab_1_prt_jkl','pt_heap_tab_1_prt_mno'));
oid | relkind | relstorage | reloptions
-----------------------+---------+------------+------------------------------------------------------
pt_heap_tab_1_prt_xyz | r | c | {appendonly=true,orientation=column,compresslevel=5}
......@@ -98,7 +98,7 @@ psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_1_prt_xyz2" for table "pt_heap_tab"
ALTER TABLE
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ('pt_heap_tab_1_prt_xyz1','pt_heap_tab_1_prt_xyz2','pt_heap_tab_1_prt_ghi1','pt_heap_tab_1_prt_ghi2','pt_heap_tab_1_prt_abc1','pt_heap_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ('pt_heap_tab_1_prt_xyz1','pt_heap_tab_1_prt_xyz2','pt_heap_tab_1_prt_ghi1','pt_heap_tab_1_prt_ghi2','pt_heap_tab_1_prt_abc1','pt_heap_tab_1_prt_abc2'));
oid | relkind | relstorage | reloptions
------------------------+---------+------------+------------------------------------------------------
pt_heap_tab_1_prt_abc1 | r | h | {appendonly=false}
......
......@@ -57,7 +57,7 @@ ALTER TABLE
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_1_prt_mno" for table "pt_ao_tab"
ALTER TABLE
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_1_prt_xyz', 'pt_ao_tab_1_prt_jkl','pt_ao_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_1_prt_xyz', 'pt_ao_tab_1_prt_jkl','pt_ao_tab_1_prt_mno'));
oid | relkind | relstorage | reloptions
---------------------+---------+------------+------------------------------------------------------
pt_ao_tab_1_prt_xyz | r | c | {appendonly=true,orientation=column,compresslevel=5}
......@@ -98,7 +98,7 @@ psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_1_
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_1_prt_xyz2" for table "pt_ao_tab"
ALTER TABLE
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select relfilenode from pg_class where relname in ('pt_ao_tab_1_prt_xyz1','pt_ao_tab_1_prt_xyz2','pt_ao_tab_1_prt_ghi1','pt_ao_tab_1_prt_ghi2','pt_ao_tab_1_prt_abc1','pt_ao_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select oid from pg_class where relname in ('pt_ao_tab_1_prt_xyz1','pt_ao_tab_1_prt_xyz2','pt_ao_tab_1_prt_ghi1','pt_ao_tab_1_prt_ghi2','pt_ao_tab_1_prt_abc1','pt_ao_tab_1_prt_abc2'));
oid | relkind | relstorage | reloptions
----------------------+---------+------------+------------------------------------------------------
pt_ao_tab_1_prt_abc1 | r | h | {appendonly=false}
......
......@@ -57,7 +57,7 @@ ALTER TABLE
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_1_prt_mno" for table "pt_co_tab"
ALTER TABLE
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_1_prt_xyz', 'pt_co_tab_1_prt_jkl','pt_co_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_1_prt_xyz', 'pt_co_tab_1_prt_jkl','pt_co_tab_1_prt_mno'));
oid | relkind | relstorage | reloptions
---------------------+---------+------------+------------------------------------------------------
pt_co_tab_1_prt_xyz | r | c | {appendonly=true,orientation=column,compresslevel=5}
......@@ -98,7 +98,7 @@ psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_1_
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_1_prt_xyz2" for table "pt_co_tab"
ALTER TABLE
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select relfilenode from pg_class where relname in ('pt_co_tab_1_prt_xyz1','pt_co_tab_1_prt_xyz2','pt_co_tab_1_prt_ghi1','pt_co_tab_1_prt_ghi2','pt_co_tab_1_prt_abc1','pt_co_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select oid from pg_class where relname in ('pt_co_tab_1_prt_xyz1','pt_co_tab_1_prt_xyz2','pt_co_tab_1_prt_ghi1','pt_co_tab_1_prt_ghi2','pt_co_tab_1_prt_abc1','pt_co_tab_1_prt_abc2'));
oid | relkind | relstorage | reloptions
----------------------+---------+------------+------------------------------------------------------
pt_co_tab_1_prt_abc1 | r | h | {appendonly=false}
......
......@@ -57,7 +57,7 @@ ALTER TABLE
alter table pt_heap_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_rng_1_prt_co" for table "pt_heap_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap', 'pt_heap_tab_rng_1_prt_ao','pt_heap_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap', 'pt_heap_tab_rng_1_prt_ao','pt_heap_tab_rng_1_prt_co'));
oid | relkind | relstorage | reloptions
----------------------------+---------+------------+--------------------------------------
pt_heap_tab_rng_1_prt_heap | r | h | {appendonly=false}
......@@ -84,7 +84,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "co" for relation "pt_heap_tab
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_rng_1_prt_co1" for table "pt_heap_tab_rng"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_heap_tab_rng_1_prt_co2" for table "pt_heap_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap1' ,'pt_heap_tab_rng_1_prt_heap2' ,'pt_heap_tab_rng_1_prt_ao1', 'pt_heap_tab_rng_1_prt_ao2', 'pt_heap_tab_rng_1_prt_co1', 'pt_heap_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap1' ,'pt_heap_tab_rng_1_prt_heap2' ,'pt_heap_tab_rng_1_prt_ao1', 'pt_heap_tab_rng_1_prt_ao2', 'pt_heap_tab_rng_1_prt_co1', 'pt_heap_tab_rng_1_prt_co2'));
oid | relkind | relstorage | reloptions
-----------------------------+---------+------------+--------------------------------------
pt_heap_tab_rng_1_prt_heap1 | r | h | {appendonly=false}
......
......@@ -57,7 +57,7 @@ ALTER TABLE
alter table pt_ao_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_rng_1_prt_co" for table "pt_ao_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap', 'pt_ao_tab_rng_1_prt_ao','pt_ao_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap', 'pt_ao_tab_rng_1_prt_ao','pt_ao_tab_rng_1_prt_co'));
oid | relkind | relstorage | reloptions
--------------------------+---------+------------+--------------------------------------
pt_ao_tab_rng_1_prt_heap | r | h | {appendonly=false}
......@@ -84,7 +84,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "co" for relation "pt_ao_tab_r
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_rng_1_prt_co1" for table "pt_ao_tab_rng"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_ao_tab_rng_1_prt_co2" for table "pt_ao_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap1' ,'pt_ao_tab_rng_1_prt_heap2' ,'pt_ao_tab_rng_1_prt_ao1', 'pt_ao_tab_rng_1_prt_ao2', 'pt_ao_tab_rng_1_prt_co1', 'pt_ao_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap1' ,'pt_ao_tab_rng_1_prt_heap2' ,'pt_ao_tab_rng_1_prt_ao1', 'pt_ao_tab_rng_1_prt_ao2', 'pt_ao_tab_rng_1_prt_co1', 'pt_ao_tab_rng_1_prt_co2'));
oid | relkind | relstorage | reloptions
---------------------------+---------+------------+--------------------------------------
pt_ao_tab_rng_1_prt_heap1 | r | h | {appendonly=false}
......
......@@ -57,7 +57,7 @@ ALTER TABLE
alter table pt_co_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_rng_1_prt_co" for table "pt_co_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap', 'pt_co_tab_rng_1_prt_ao','pt_co_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap', 'pt_co_tab_rng_1_prt_ao','pt_co_tab_rng_1_prt_co'));
oid | relkind | relstorage | reloptions
--------------------------+---------+------------+--------------------------------------
pt_co_tab_rng_1_prt_heap | r | h | {appendonly=false}
......@@ -84,7 +84,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "co" for relation "pt_co_tab_r
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_rng_1_prt_co1" for table "pt_co_tab_rng"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "pt_co_tab_rng_1_prt_co2" for table "pt_co_tab_rng"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap1' ,'pt_co_tab_rng_1_prt_heap2' ,'pt_co_tab_rng_1_prt_ao1', 'pt_co_tab_rng_1_prt_ao2', 'pt_co_tab_rng_1_prt_co1', 'pt_co_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap1' ,'pt_co_tab_rng_1_prt_heap2' ,'pt_co_tab_rng_1_prt_ao1', 'pt_co_tab_rng_1_prt_ao2', 'pt_co_tab_rng_1_prt_co1', 'pt_co_tab_rng_1_prt_co2'));
oid | relkind | relstorage | reloptions
---------------------------+---------+------------+--------------------------------------
pt_co_tab_rng_1_prt_heap1 | r | h | {appendonly=false}
......
......@@ -173,7 +173,7 @@ Alter table mpp17761.split_tab1 split partition FOR (RANK(2)) at(1050) into (par
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab1_1_prt_splitc" for table "split_tab1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab1_1_prt_splitd" for table "split_tab1"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab1_1_prt_splitc','split_tab1_1_prt_splitd','split_tab1','split_tab1_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab1_1_prt_splitc','split_tab1_1_prt_splitd','split_tab1','split_tab1_1_prt_1'));
oid | relkind | relstorage | reloptions
----------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab1_1_prt_1 | r | c | {appendonly=true,orientation=column}
......@@ -201,7 +201,7 @@ Alter table mpp17761.split_tab6 split partition FOR (RANK(2)) at(1050) into (par
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab6_1_prt_splitc" for table "split_tab6"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab6_1_prt_splitd" for table "split_tab6"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab6_1_prt_splitc','split_tab6_1_prt_splitd','split_tab6','split_tab6_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab6_1_prt_splitc','split_tab6_1_prt_splitd','split_tab6','split_tab6_1_prt_1'));
oid | relkind | relstorage | reloptions
----------------------------------+---------+------------+--------------------------------------------------------
mpp17761.split_tab6_1_prt_1 | r | a | {appendonly=true,compresstype=quicklz,compresslevel=1}
......@@ -229,7 +229,7 @@ Alter table mpp17761.split_tab7 split partition FOR (RANK(2)) at(1050) into (par
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab7_1_prt_splitc" for table "split_tab7"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab7_1_prt_splitd" for table "split_tab7"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab7_1_prt_splitc','split_tab7_1_prt_splitd','split_tab7','split_tab7_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab7_1_prt_splitc','split_tab7_1_prt_splitd','split_tab7','split_tab7_1_prt_1'));
oid | relkind | relstorage | reloptions
----------------------------------+---------+------------+--------------------
mpp17761.split_tab7_1_prt_1 | r | h | {appendonly=false}
......@@ -256,7 +256,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab2_1_prt_one" for table "split_tab2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab2_1_prt_two" for table "split_tab2"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab2_1_prt_one','split_tab2_1_prt_two','split_tab2_1_prt_b','split_tab2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab2_1_prt_one','split_tab2_1_prt_two','split_tab2_1_prt_b','split_tab2'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab2_1_prt_b | r | c | {appendonly=true,orientation=column}
......@@ -286,7 +286,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "c" for relation "split_tab8"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab8_1_prt_one" for table "split_tab8"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab8_1_prt_two" for table "split_tab8"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab8_1_prt_one','split_tab8_1_prt_two','split_tab8_1_prt_b','split_tab8'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab8_1_prt_one','split_tab8_1_prt_two','split_tab8_1_prt_b','split_tab8'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab8_1_prt_b | r | c | {appendonly=true,orientation=column}
......@@ -313,7 +313,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab9"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab9_1_prt_one" for table "split_tab9"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab9_1_prt_two" for table "split_tab9"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab9_1_prt_one','split_tab9_1_prt_two','split_tab9_1_prt_b','split_tab9'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab9_1_prt_one','split_tab9_1_prt_two','split_tab9_1_prt_b','split_tab9'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+--------------------
mpp17761.split_tab9_1_prt_b | r | h | {appendonly=false}
......@@ -344,7 +344,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "co" for relation "split_tab3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab3_1_prt_co1" for table "split_tab3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab3_1_prt_co2" for table "split_tab3"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab3_1_prt_1','split_tab3_1_prt_co1','split_tab3'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab3_1_prt_1','split_tab3_1_prt_co1','split_tab3'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+---------------------------------------------------------------------------
mpp17761.split_tab3_1_prt_1 | r | c | {appendonly=true,orientation=column,compresstype=quicklz,compresslevel=1}
......@@ -370,7 +370,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab10"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab10_1_prt_one" for table "split_tab10"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab10_1_prt_two" for table "split_tab10"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab10_1_prt_one','split_tab10_1_prt_two','split_tab10_1_prt_b','split_tab10'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab10_1_prt_one','split_tab10_1_prt_two','split_tab10_1_prt_b','split_tab10'));
oid | relkind | relstorage | reloptions
--------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab10_1_prt_b | r | a | {appendonly=true}
......@@ -397,7 +397,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab11"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab11_1_prt_one" for table "split_tab11"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab11_1_prt_two" for table "split_tab11"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab11_1_prt_one','split_tab11_1_prt_two','split_tab11_1_prt_b','split_tab11'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab11_1_prt_one','split_tab11_1_prt_two','split_tab11_1_prt_b','split_tab11'));
oid | relkind | relstorage | reloptions
--------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab11_1_prt_b | r | h | {appendonly=false}
......@@ -424,7 +424,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab12"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab12_1_prt_one" for table "split_tab12"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab12_1_prt_two" for table "split_tab12"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab12_1_prt_one','split_tab12_1_prt_two','split_tab12_1_prt_b','split_tab12'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab12_1_prt_one','split_tab12_1_prt_two','split_tab12_1_prt_b','split_tab12'));
oid | relkind | relstorage | reloptions
--------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab12_1_prt_b | r | h | {appendonly=false}
......@@ -451,7 +451,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "a" for relation "split_tab13"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab13_1_prt_one" for table "split_tab13"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab13_1_prt_two" for table "split_tab13"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab13_1_prt_one','split_tab13_1_prt_two','split_tab13_1_prt_b','split_tab13'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab13_1_prt_one','split_tab13_1_prt_two','split_tab13_1_prt_b','split_tab13'));
oid | relkind | relstorage | reloptions
--------------------------------+---------+------------+--------------------------------------------------------
mpp17761.split_tab13_1_prt_b | r | h | {appendonly=false}
......@@ -482,7 +482,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "co" for relation "split_tab14
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab14_1_prt_co1" for table "split_tab14"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab14_1_prt_co2" for table "split_tab14"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab14_1_prt_1','split_tab14_1_prt_co1','split_tab14_1_prt_co1','split_tab14'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab14_1_prt_1','split_tab14_1_prt_co1','split_tab14_1_prt_co1','split_tab14'));
oid | relkind | relstorage | reloptions
--------------------------------+---------+------------+--------------------
mpp17761.split_tab14_1_prt_1 | r | h | {appendonly=false}
......@@ -506,7 +506,7 @@ psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab4_1
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab4_1_prt_b" for table "split_tab4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab4_1_prt_dft" for table "split_tab4"
CREATE TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab4_1_prt_a | r | c | {appendonly=true,orientation=column}
......@@ -520,7 +520,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "dft" for relation "split_tab4
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab4_1_prt_c" for table "split_tab4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab4_1_prt_dft" for table "split_tab4"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft','split_tab4_1_prt_c'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft','split_tab4_1_prt_c'));
oid | relkind | relstorage | reloptions
-------------------------------+---------+------------+--------------------------------------
mpp17761.split_tab4_1_prt_a | r | c | {appendonly=true,orientation=column}
......@@ -545,7 +545,7 @@ CREATE TABLE
alter table mpp17761.split_tab5 add partition c values (10,11,12,13) with (appendonly = false);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab5_1_prt_c" for table "split_tab5"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_c','split_tab5'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_c','split_tab5'));
oid | relkind | relstorage | reloptions
-----------------------------+---------+------------+--------------------------------------
mpp17761.split_tab5_1_prt_a | r | a | {appendonly=true}
......@@ -560,7 +560,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "c" for relation "split_tab5"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab5_1_prt_d" for table "split_tab5"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab5_1_prt_e" for table "split_tab5"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_d','split_tab5'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_d','split_tab5'));
oid | relkind | relstorage | reloptions
-----------------------------+---------+------------+--------------------------------------
mpp17761.split_tab5_1_prt_a | r | a | {appendonly=true}
......@@ -583,7 +583,7 @@ CREATE TABLE
alter table mpp17761.split_tab15 add partition c start(25) end(30) with (appendonly = false);
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab15_1_prt_c" for table "split_tab15"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15_1_prt_c','split_tab15'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15_1_prt_c','split_tab15'));
oid | relkind | relstorage | reloptions
------------------------------+---------+------------+--------------------
mpp17761.split_tab15_1_prt_1 | r | a | {appendonly=true}
......@@ -599,7 +599,7 @@ psql:/path/sql_file:1: NOTICE: dropped partition "c" for relation "split_tab15"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab15_1_prt_d" for table "split_tab15"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "split_tab15_1_prt_e" for table "split_tab15"
ALTER TABLE
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15','split_tab15_1_prt_e'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15','split_tab15_1_prt_e'));
oid | relkind | relstorage | reloptions
------------------------------+---------+------------+--------------------
mpp17761.split_tab15_1_prt_1 | r | a | {appendonly=true}
......
......@@ -34,7 +34,7 @@ drop index if exists heap_idx2 cascade;
alter table pt_heap_tab add partition mno values ('mno','mno1','mno2') WITH (appendonly=false); --Heap
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_1_prt_xyz', 'pt_heap_tab_1_prt_jkl','pt_heap_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_1_prt_xyz', 'pt_heap_tab_1_prt_jkl','pt_heap_tab_1_prt_mno'));
--Insert Data
insert into pt_heap_tab select 1, 'xyz', 1, 1, 1.0 , true from generate_series(1, 100);
......@@ -50,7 +50,7 @@ drop index if exists heap_idx2 cascade;
alter table pt_heap_tab split partition xyz at ('xyz1') into ( partition xyz1,partition xyz2); --CO
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ('pt_heap_tab_1_prt_xyz1','pt_heap_tab_1_prt_xyz2','pt_heap_tab_1_prt_ghi1','pt_heap_tab_1_prt_ghi2','pt_heap_tab_1_prt_abc1','pt_heap_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ('pt_heap_tab_1_prt_xyz1','pt_heap_tab_1_prt_xyz2','pt_heap_tab_1_prt_ghi1','pt_heap_tab_1_prt_ghi2','pt_heap_tab_1_prt_abc1','pt_heap_tab_1_prt_abc2'));
--Exchange partition
-- Create candidate table
......
......@@ -34,7 +34,7 @@ drop index if exists ao_idx2 cascade;
alter table pt_ao_tab add partition mno values ('mno','mno1','mno2') WITH (appendonly=false); --Heap
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_1_prt_xyz', 'pt_ao_tab_1_prt_jkl','pt_ao_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_1_prt_xyz', 'pt_ao_tab_1_prt_jkl','pt_ao_tab_1_prt_mno'));
--Insert Data
insert into pt_ao_tab select 1, 'xyz', 1, 1, 1.0 , true from generate_series(1, 100);
......@@ -50,7 +50,8 @@ drop index if exists ao_idx2 cascade;
alter table pt_ao_tab split partition xyz at ('xyz1') into ( partition xyz1,partition xyz2); --CO
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select relfilenode from pg_class where relname in ('pt_ao_tab_1_prt_xyz1','pt_ao_tab_1_prt_xyz2','pt_ao_tab_1_prt_ghi1','pt_ao_tab_1_prt_ghi2','pt_ao_tab_1_prt_abc1','pt_ao_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select oid from pg_class where relname in ('pt_ao_tab_1_prt_xyz1','pt_ao_tab_1_prt_xyz2','pt_ao_tab_1_prt_ghi1','pt_ao_tab_1_prt_ghi2','pt_ao_tab_1_prt_abc1','pt_ao_tab_1_prt_abc2'));
--Exchange partition
-- Create candidate table
--start_ignore
......
......@@ -34,7 +34,7 @@ drop index if exists co_idx2 cascade;
alter table pt_co_tab add partition mno values ('mno','mno1','mno2') WITH (appendonly=false); --Heap
--Check properties of the added partition tables
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_1_prt_xyz', 'pt_co_tab_1_prt_jkl','pt_co_tab_1_prt_mno'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_1_prt_xyz', 'pt_co_tab_1_prt_jkl','pt_co_tab_1_prt_mno'));
--Insert Data
insert into pt_co_tab select 1, 'xyz', 1, 1, 1.0 , true from generate_series(1, 100);
......@@ -50,7 +50,7 @@ drop index if exists co_idx2 cascade;
alter table pt_co_tab split partition xyz at ('xyz1') into ( partition xyz1,partition xyz2); --CO
--Check the storage type and properties of the split partition
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select relfilenode from pg_class where relname in ('pt_co_tab_1_prt_xyz1','pt_co_tab_1_prt_xyz2','pt_co_tab_1_prt_ghi1','pt_co_tab_1_prt_ghi2','pt_co_tab_1_prt_abc1','pt_co_tab_1_prt_abc2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in (select oid from pg_class where relname in ('pt_co_tab_1_prt_xyz1','pt_co_tab_1_prt_xyz2','pt_co_tab_1_prt_ghi1','pt_co_tab_1_prt_ghi2','pt_co_tab_1_prt_abc1','pt_co_tab_1_prt_abc2'));
--Exchange partition
-- Create candidate table
......
......@@ -30,13 +30,13 @@ drop index if exists heap_rng_idx2 cascade;
alter table pt_heap_tab_rng add partition ao start(25) end(30) with (appendonly=true);
alter table pt_heap_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap', 'pt_heap_tab_rng_1_prt_ao','pt_heap_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap', 'pt_heap_tab_rng_1_prt_ao','pt_heap_tab_rng_1_prt_co'));
-- Split partition
alter table pt_heap_tab_rng split partition heap at (23) into (partition heap1,partition heap2);
alter table pt_heap_tab_rng split partition ao at (27) into (partition ao1,partition ao2);
alter table pt_heap_tab_rng split partition co at (33) into (partition co1,partition co2);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap1' ,'pt_heap_tab_rng_1_prt_heap2' ,'pt_heap_tab_rng_1_prt_ao1', 'pt_heap_tab_rng_1_prt_ao2', 'pt_heap_tab_rng_1_prt_co1', 'pt_heap_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_heap_tab_rng_1_prt_heap1' ,'pt_heap_tab_rng_1_prt_heap2' ,'pt_heap_tab_rng_1_prt_ao1', 'pt_heap_tab_rng_1_prt_ao2', 'pt_heap_tab_rng_1_prt_co1', 'pt_heap_tab_rng_1_prt_co2'));
-- Exchange
-- Create candidate table
......
......@@ -31,13 +31,13 @@ drop index if exists ao_rng_idx2 cascade;
alter table pt_ao_tab_rng add partition ao start(25) end(30) with (appendonly=true);
alter table pt_ao_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap', 'pt_ao_tab_rng_1_prt_ao','pt_ao_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap', 'pt_ao_tab_rng_1_prt_ao','pt_ao_tab_rng_1_prt_co'));
--Split partition
alter table pt_ao_tab_rng split partition heap at (23) into (partition heap1,partition heap2);
alter table pt_ao_tab_rng split partition ao at (27) into (partition ao1,partition ao2);
alter table pt_ao_tab_rng split partition co at (33) into (partition co1,partition co2);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap1' ,'pt_ao_tab_rng_1_prt_heap2' ,'pt_ao_tab_rng_1_prt_ao1', 'pt_ao_tab_rng_1_prt_ao2', 'pt_ao_tab_rng_1_prt_co1', 'pt_ao_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_ao_tab_rng_1_prt_heap1' ,'pt_ao_tab_rng_1_prt_heap2' ,'pt_ao_tab_rng_1_prt_ao1', 'pt_ao_tab_rng_1_prt_ao2', 'pt_ao_tab_rng_1_prt_co1', 'pt_ao_tab_rng_1_prt_co2'));
--Exchange
-- Create candidate table
......
......@@ -30,13 +30,13 @@ drop index if exists co_rng_idx2 cascade;
alter table pt_co_tab_rng add partition ao start(25) end(30) with (appendonly=true);
alter table pt_co_tab_rng add partition co start(31) end(35) with (appendonly=true,orientation=column);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap', 'pt_co_tab_rng_1_prt_ao','pt_co_tab_rng_1_prt_co'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap', 'pt_co_tab_rng_1_prt_ao','pt_co_tab_rng_1_prt_co'));
--Split partition
alter table pt_co_tab_rng split partition heap at (23) into (partition heap1,partition heap2);
alter table pt_co_tab_rng split partition ao at (27) into (partition ao1,partition ao2);
alter table pt_co_tab_rng split partition co at (33) into (partition co1,partition co2);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap1' ,'pt_co_tab_rng_1_prt_heap2' ,'pt_co_tab_rng_1_prt_ao1', 'pt_co_tab_rng_1_prt_ao2', 'pt_co_tab_rng_1_prt_co1', 'pt_co_tab_rng_1_prt_co2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'pt_co_tab_rng_1_prt_heap1' ,'pt_co_tab_rng_1_prt_heap2' ,'pt_co_tab_rng_1_prt_ao1', 'pt_co_tab_rng_1_prt_ao2', 'pt_co_tab_rng_1_prt_co1', 'pt_co_tab_rng_1_prt_co2'));
--Exchange
-- Create candidate table
......
......@@ -12,7 +12,7 @@ CREATE TABLE mpp17761.split_tab1
Alter table mpp17761.split_tab1 split partition FOR (RANK(2)) at(1050) into (partition splitc,partition splitd) ;
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab1_1_prt_splitc','split_tab1_1_prt_splitd','split_tab1','split_tab1_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab1_1_prt_splitc','split_tab1_1_prt_splitd','split_tab1','split_tab1_1_prt_1'));
\echo '-- CASE#2 ( AO TABLE )'
CREATE TABLE mpp17761.split_tab6(id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 char DEFAULT 'd')
......@@ -24,7 +24,7 @@ Partition by range(a1)
Alter table mpp17761.split_tab6 split partition FOR (RANK(2)) at(1050) into (partition splitc,partition splitd) ;
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab6_1_prt_splitc','split_tab6_1_prt_splitd','split_tab6','split_tab6_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab6_1_prt_splitc','split_tab6_1_prt_splitd','split_tab6','split_tab6_1_prt_1'));
\echo '-- CASE#3 ( HEAP TABLE )'
......@@ -37,7 +37,7 @@ Partition by range(a1)
Alter table mpp17761.split_tab7 split partition FOR (RANK(2)) at(1050) into (partition splitc,partition splitd) ;
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab7_1_prt_splitc','split_tab7_1_prt_splitd','split_tab7','split_tab7_1_prt_1'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab7_1_prt_splitc','split_tab7_1_prt_splitd','split_tab7','split_tab7_1_prt_1'));
\echo '-- CASE#4 ( PARENT: AO CHILD: CO )'
create table mpp17761.split_tab2( a int, b int) with (appendonly=true) partition by list(b)
......@@ -48,7 +48,7 @@ create table mpp17761.split_tab2( a int, b int) with (appendonly=true) partition
alter table mpp17761.split_tab2 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab2_1_prt_one','split_tab2_1_prt_two','split_tab2_1_prt_b','split_tab2'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab2_1_prt_one','split_tab2_1_prt_two','split_tab2_1_prt_b','split_tab2'));
\echo '-- CASE#5 ( PARENT: AO CHILD: AO )'
......@@ -62,7 +62,7 @@ alter table mpp17761.split_tab8 add partition c values (11,12,13) with (appendon
alter table mpp17761.split_tab8 split partition c at (12) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab8_1_prt_one','split_tab8_1_prt_two','split_tab8_1_prt_b','split_tab8'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab8_1_prt_one','split_tab8_1_prt_two','split_tab8_1_prt_b','split_tab8'));
\echo '-- CASE#6 ( PARENT: AO CHILD: HEAP )'
......@@ -74,7 +74,7 @@ create table mpp17761.split_tab9( a int, b int) with (appendonly=true) partition
alter table mpp17761.split_tab9 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab9_1_prt_one','split_tab9_1_prt_two','split_tab9_1_prt_b','split_tab9'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab9_1_prt_one','split_tab9_1_prt_two','split_tab9_1_prt_b','split_tab9'));
\echo '-- CASE#7 ( PARENT: CO CHILD: CO )'
......@@ -89,7 +89,7 @@ alter table mpp17761.split_tab3 add partition co start(31) end(35) with (appendo
alter table mpp17761.split_tab3 split partition co at (33) into (partition co1,partition co2);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab3_1_prt_1','split_tab3_1_prt_co1','split_tab3'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab3_1_prt_1','split_tab3_1_prt_co1','split_tab3'));
\echo '-- CASE#8 ( PARENT: CO CHILD: AO )'
create table mpp17761.split_tab10( a int, b int) with (appendonly=true,orientation=column) partition by list(b)
......@@ -100,7 +100,7 @@ create table mpp17761.split_tab10( a int, b int) with (appendonly=true,orientati
alter table mpp17761.split_tab10 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab10_1_prt_one','split_tab10_1_prt_two','split_tab10_1_prt_b','split_tab10'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab10_1_prt_one','split_tab10_1_prt_two','split_tab10_1_prt_b','split_tab10'));
\echo '-- CASE#9 ( PARENT: CO CHILD: HEAP )'
......@@ -112,7 +112,7 @@ create table mpp17761.split_tab11( a int, b int) with (appendonly=true,orientati
alter table mpp17761.split_tab11 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab11_1_prt_one','split_tab11_1_prt_two','split_tab11_1_prt_b','split_tab11'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab11_1_prt_one','split_tab11_1_prt_two','split_tab11_1_prt_b','split_tab11'));
\echo '-- CASE#10 ( PARENT: HEAP CHILD: CO )'
......@@ -124,7 +124,7 @@ create table mpp17761.split_tab12( a int, b int) with (appendonly=false) partiti
alter table mpp17761.split_tab12 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab12_1_prt_one','split_tab12_1_prt_two','split_tab12_1_prt_b','split_tab12'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab12_1_prt_one','split_tab12_1_prt_two','split_tab12_1_prt_b','split_tab12'));
\echo '-- CASE#11 ( PARENT: HEAP CHILD: AO )'
......@@ -137,7 +137,7 @@ create table mpp17761.split_tab13( a int, b int) with (appendonly=false) partiti
alter table mpp17761.split_tab13 split partition for(2) at(2) into (partition one,partition two);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab13_1_prt_one','split_tab13_1_prt_two','split_tab13_1_prt_b','split_tab13'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab13_1_prt_one','split_tab13_1_prt_two','split_tab13_1_prt_b','split_tab13'));
\echo '-- CASE#12 ( PARENT: HEAP CHILD: HEAP )'
......@@ -152,7 +152,7 @@ alter table mpp17761.split_tab14 add partition co start(31) end(35) with (append
alter table mpp17761.split_tab14 split partition co at (33) into (partition co1,partition co2);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab14_1_prt_1','split_tab14_1_prt_co1','split_tab14_1_prt_co1','split_tab14'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab14_1_prt_1','split_tab14_1_prt_co1','split_tab14_1_prt_co1','split_tab14'));
\echo '--CASE#13 (CO table with default partition )'
......@@ -165,11 +165,11 @@ partition by list(a3)
default partition dft
);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft'));
alter table mpp17761.split_tab4 split default partition at (20.0) into (partition dft,partition c);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft','split_tab4_1_prt_c'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab4_1_prt_a','split_tab4','split_tab4_1_prt_dft','split_tab4_1_prt_c'));
\echo '-- CASE#14 ( CO table , add heap partition , split)'
create table mpp17761.split_tab5( a int, b int, c char(5), d boolean default true) with (appendonly=true, orientation=column )
......@@ -183,11 +183,11 @@ partition by list(b)
alter table mpp17761.split_tab5 add partition c values (10,11,12,13) with (appendonly = false);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_c','split_tab5'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_c','split_tab5'));
alter table mpp17761.split_tab5 split partition c at(12) into (partition d,partition e);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_d','split_tab5'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab5_1_prt_a','split_tab5_1_prt_b','split_tab5_1_prt_d','split_tab5'));
\echo '-- CASE#15 ( AO table , add Heap partition, split )'
......@@ -200,10 +200,10 @@ partition by range(b)
--add heap partition
alter table mpp17761.split_tab15 add partition c start(25) end(30) with (appendonly = false);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15_1_prt_c','split_tab15'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15_1_prt_c','split_tab15'));
--split heap partition
alter table mpp17761.split_tab15 split partition c at(27) into (partition d,partition e);
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select relfilenode from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15','split_tab15_1_prt_e'));
select oid::regclass, relkind, relstorage, reloptions from pg_class where oid in ( select oid from pg_class where relname in ( 'split_tab15_1_prt_1','split_tab15_1_prt_2','split_tab15','split_tab15_1_prt_e'));
......@@ -5,6 +5,30 @@
-- @product_version gpdb: 4.2, 4.3
-- @description Transaction on AO table
CREATE OR REPLACE FUNCTION check_mirror_down() RETURNS boolean AS
$$
DECLARE
counter integer :=0;
num_loops integer :=0;
BEGIN
LOOP
IF num_loops > 30 THEN
RETURN false;
END IF;
SELECT count(*) FROM gp_segment_configuration WHERE role='m' AND status='d' INTO counter;
IF counter > 0 THEN
RETURN true;
END IF;
PERFORM pg_sleep(10);
num_loops := num_loops + 1;
END LOOP;
END;
$$ LANGUAGE plpgsql;
BEGIN;
INSERT INTO ta
......@@ -12,7 +36,7 @@ VALUES(0),(1);
-- Sleep introduced so that all the mirror segments gets
-- killed before aborting
SELECT pg_sleep(300);
SELECT * FROM check_mirror_down();
ABORT;
......
......@@ -40,7 +40,7 @@ class Schema(Command):
def check_duplicate_entries_in_PT(self):
'''Checking duplicate entries in the Persistent table'''
cmd_str = "select count(*) from gp_dist_random('gp_persistent_relation_node') where segment_file_num = 1 and relfilenode_oid = 'ta'::regclass group by relfilenode_oid, gp_segment_id;"
cmd_str = "select count(*) from gp_dist_random('gp_persistent_relation_node') where segment_file_num = 1 and relfilenode_oid in (select relfilenode from gp_dist_random('pg_class') where relname = 'ta') group by relfilenode_oid, gp_segment_id;"
out = PSQL.run_sql_command(cmd_str).split('\n')[3:-3]
if len(out) == 0:
exception_msg = "ERROR!! No values returned for the duplicate entries query. " \
......
......@@ -7,13 +7,17 @@ BEGIN
REINDEX
1: ROLLBACK;
ROLLBACK
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_reindex_abort_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_reindex_abort_ao' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 as relfilenode_didnot_change from pg_class where relname = 'idx_btree_reindex_abort_ao' and relfilenode = oid;
3: SELECT 1 as relfilenode_didnot_change from pg_class pc, reindex_abort_ao_old re where pc.relname = 'idx_btree_reindex_abort_ao' and pc.relfilenode = re.c_relfilenode and pc.gp_segment_id = re.c_gp_segment_id;
relfilenode_didnot_change
-------------------------
1
1
(1 row)
3: SELECT * from reindex_abort_ao_old o where o.c_gp_segment_id > -1 and exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') g where relname = 'idx_btree_reindex_abort_ao' and o.c_oid = g.oid and o.c_gp_segment_id = g.gp_segment_id and o.c_relfilenode != g.relfilenode);
c_oid|c_gp_segment_id|c_relfilenode
-----+---------------+-------------
(0 rows)
......@@ -7,8 +7,18 @@ insert into reindex_abort_ao select generate_series(1,1000);
INSERT 1000
create index idx_btree_reindex_abort_ao on reindex_abort_ao(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_reindex_abort_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
-- start_ignore
drop table if exists reindex_abort_ao_old;
DROP
create table reindex_abort_ao_old as
(select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode from pg_class where relname = 'idx_btree_reindex_abort_ao' union all
select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode from gp_dist_random('pg_class') where relname = 'idx_btree_reindex_abort_ao');
CREATE 3
-- end_ignore
select 1 as have_same_number_of_rows from reindex_abort_ao_old where c_gp_segment_id > -1 group by c_oid having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
have_same_number_of_rows
------------------------
1
(1 row)
......@@ -25,13 +25,13 @@ count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -12,28 +12,28 @@ INSERT 1000
create index idx_gist_reindex_ao on reindex_ao_gist USING Gist(target);
CREATE
-- Verify relfilenode is same on all the segments
SELECT 1 AS idx_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_relfilenode_same_on_all_segs
--------------------------------
1
-- Verify oid is same on all the segments
SELECT 1 AS idx_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_oid_same_on_all_segs
------------------------
1
(1 row)
SELECT 1 AS table_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_relfilenode_same_on_all_segs
----------------------------------
1
SELECT 1 AS table_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_oid_same_on_all_segs
--------------------------
1
(1 row)
SELECT 1 AS table_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_relfilenode_same_on_all_segs
----------------------------------
1
SELECT 1 AS table_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_oid_same_on_all_segs
--------------------------
1
(1 row)
SELECT 1 AS table_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_relfilenode_same_on_all_segs
----------------------------------
1
SELECT 1 AS table_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_oid_same_on_all_segs
--------------------------
1
(1 row)
......@@ -40,33 +40,33 @@ count
1747
(1 row)
-- Verify relfilenode is same on all the segments
3: SELECT 1 AS idx_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_relfilenode_same_on_all_segs
--------------------------------
1
-- Verify oid is same on all the segments
3: SELECT 1 AS idx_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_oid_same_on_all_segs
------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS table_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_relfilenode_same_on_all_segs
----------------------------------
1
3: SELECT 1 AS table_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_oid_same_on_all_segs
--------------------------
1
(1 row)
3: SELECT 1 AS partition_one_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
partition_one_relfilenode_same_on_all_segs
------------------------------------------
1
3: SELECT 1 AS partition_one_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
partition_one_oid_same_on_all_segs
----------------------------------
1
(1 row)
3: SELECT 1 AS default_partition_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
default_partition_relfilenode_same_on_all_segs
----------------------------------------------
1
3: SELECT 1 AS default_partition_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
default_partition_oid_same_on_all_segs
--------------------------------------
1
(1 row)
......@@ -12,28 +12,28 @@ INSERT 1000
create index idx_gist_reindex_ao on reindex_ao_gist USING Gist(target);
CREATE
-- Verify relfilenode is same on all the segments
SELECT 1 AS idx_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_relfilenode_same_on_all_segs
--------------------------------
1
-- Verify oid is same on all the segments
SELECT 1 AS idx_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_ao' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
idx_oid_same_on_all_segs
------------------------
1
(1 row)
SELECT 1 AS table_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_relfilenode_same_on_all_segs
----------------------------------
1
SELECT 1 AS table_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
table_oid_same_on_all_segs
--------------------------
1
(1 row)
SELECT 1 AS partition_one_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
partition_one_relfilenode_same_on_all_segs
------------------------------------------
1
SELECT 1 AS partition_one_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_p_one' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
partition_one_oid_same_on_all_segs
----------------------------------
1
(1 row)
SELECT 1 AS default_partition_relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
default_partition_relfilenode_same_on_all_segs
----------------------------------------------
1
SELECT 1 AS default_partition_oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_ao_gist_1_prt_de_fault' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
default_partition_oid_same_on_all_segs
--------------------------------------
1
(1 row)
......@@ -40,13 +40,13 @@ count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -12,9 +12,9 @@ INSERT 1000
create index idx_gist_reindex_aoco on reindex_aoco_gist USING Gist(target);
CREATE
-- Verify relfilenode is same on all the segments
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
-- Verify oid is same on all the segments
SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_aoco' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -40,13 +40,13 @@ count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -12,9 +12,9 @@ INSERT 1000
create index idx_gist_reindex_heap on reindex_heap_gist USING Gist(target);
CREATE
-- Verify relfilenode is same on all the segments
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
-- Verify oid is same on all the segments
SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_gist_reindex_heap' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_bitmap' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_bitmap2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_bitmap2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -9,9 +9,9 @@ insert into reindex_crtab_ao_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_ao_bitmap on reindex_crtab_ao_bitmap USING bitmap(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_bitmap' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_btree2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_btree2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -9,9 +9,9 @@ insert into reindex_crtab_ao_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_ao_btree on reindex_crtab_ao_btree(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_btree' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_btree' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_bitmap' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_bitmap2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_bitmap2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -9,9 +9,9 @@ insert into reindex_crtab_aoco_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_aoco_bitmap on reindex_crtab_aoco_bitmap USING bitmap(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_bitmap' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_btree2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_btree2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -9,9 +9,9 @@ insert into reindex_crtab_aoco_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_aoco_btree on reindex_crtab_aoco_btree(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_btree' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_btree' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_bitmap' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_bitmap2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_bitmap2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -7,9 +7,9 @@ insert into reindex_crtab_heap_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_heap_bitmap on reindex_crtab_heap_bitmap(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_heap_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_heap_bitmap' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -15,13 +15,13 @@ CREATE
COMMIT
2: COMMIT;
COMMIT
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_btree2' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
3: SELECT 1 AS oid_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_btree2' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -7,9 +7,9 @@ insert into reindex_crtab_heap_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_heap_btree on reindex_crtab_heap_btree(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_heap_btree' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
select 1 as oid_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_heap_btree' group by oid having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
oid_same_on_all_segs
--------------------
1
(1 row)
......@@ -2,77 +2,49 @@
-- @Description Ensures that a reindex table during alter tab add partition operations is ok
--
DELETE FROM reindex_crtabforalter_part_ao_btree WHERE id < 12;
DELETE FROM reindex_crtabforadd_part_ao_btree WHERE id < 12;
DELETE 8
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtabforalter_part_ao_btree;
1: REINDEX TABLE reindex_crtabforadd_part_ao_btree;
REINDEX
2&: alter table reindex_crtabforalter_part_ao_btree add partition p1 START (date '2013-05-01') INCLUSIVE with(appendonly=true); <waiting ...>
2&: alter table reindex_crtabforadd_part_ao_btree add partition p1 START (date '2013-05-01') INCLUSIVE with(appendonly=true); <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: Insert into reindex_crtabforalter_part_ao_btree values(9,'2013-05-22',14.22); 3: select count(*) from reindex_crtabforalter_part_ao_btree where id = 29;
3: Insert into reindex_crtabforadd_part_ao_btree values(9,'2013-05-22',14.22); 3: select count(*) from reindex_crtabforadd_part_ao_btree where id = 29;
INSERT 1
3: set enable_seqscan=false;
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtabforalter_part_ao_btree where id = 29;
3: select count(*) from reindex_crtabforadd_part_ao_btree where id = 29;
count
-----
4
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforadd_part_ao_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_ao_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
-------------------------------------------------------+---------------------
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_jul13|1
idx_reindex_crtabforadd_part_ao_btree |1
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_sep13|1
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_aug13|1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_ao_btree_1_prt_p1' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_data
---------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_p1' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_data
-----------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_p1_id_key' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_idx
----------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_ao_btree_1_prt_p1_id_key' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_idx
--------------------------------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtabforalter_part_ao_btree;
DROP TABLE IF EXISTS reindex_crtabforadd_part_ao_btree;
DROP
CREATE TABLE reindex_crtabforalter_part_ao_btree (id int, date date, amt decimal(10,2)) with (appendonly=true) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE TABLE reindex_crtabforadd_part_ao_btree (id int, date date, amt decimal(10,2)) with (appendonly=true) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE
Insert into reindex_crtabforalter_part_ao_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_ao_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_ao_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_ao_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_ao_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_ao_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_ao_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_ao_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
INSERT 21
create index idx_reindex_crtabforalter_part_ao_btree on reindex_crtabforalter_part_ao_btree(id);
create index idx_reindex_crtabforadd_part_ao_btree on reindex_crtabforadd_part_ao_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforadd_part_ao_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_ao_btree%';
CREATE 8
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforadd_part_ao_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
-------------------------------------------------------+------------------------
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_aug13|1
idx_reindex_crtabforadd_part_ao_btree |1
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_jul13|1
idx_reindex_crtabforadd_part_ao_btree_1_prt_sales_sep13|1
(4 rows)
......@@ -2,24 +2,24 @@
-- @Description Ensures that a reindex table during alter tab add partition operations is ok
--
DELETE FROM reindex_crtabforalter_part_aoco_btree WHERE id < 12;
DELETE FROM reindex_crtabforadd_part_aoco_btree WHERE id < 12;
DELETE 8
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtabforalter_part_aoco_btree;
1: REINDEX TABLE reindex_crtabforadd_part_aoco_btree;
REINDEX
2&: alter table reindex_crtabforalter_part_aoco_btree add default partition part_others with(appendonly=true, orientation=column); <waiting ...>
2&: alter table reindex_crtabforadd_part_aoco_btree add default partition part_others with(appendonly=true, orientation=column); <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: Insert into reindex_crtabforalter_part_aoco_btree values(29,'2013-04-22',12.52);
3: Insert into reindex_crtabforadd_part_aoco_btree values(29,'2013-04-22',12.52);
INSERT 1
3: select count(*) from reindex_crtabforalter_part_aoco_btree where id = 29;
3: select count(*) from reindex_crtabforadd_part_aoco_btree where id = 29;
count
-----
5
......@@ -28,56 +28,28 @@ count
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtabforalter_part_aoco_btree where id = 29;
3: select count(*) from reindex_crtabforadd_part_aoco_btree where id = 29;
count
-----
5
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforadd_part_aoco_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_aoco_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
---------------------------------------------------------+---------------------
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_aug13|1
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_sep13|1
idx_reindex_crtabforadd_part_aoco_btree |1
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_jul13|1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_aoco_btree_1_prt_part_others' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_data
---------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_part_others' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_data
-----------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_part_others_id_key' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_idx
----------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_aoco_btree_1_prt_part_others_id_key' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_idx
--------------------------------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtabforalter_part_aoco_btree;
DROP TABLE IF EXISTS reindex_crtabforadd_part_aoco_btree;
DROP
CREATE TABLE reindex_crtabforalter_part_aoco_btree (id int, date date, amt decimal(10,2)) with (appendonly=true, orientation=column) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE TABLE reindex_crtabforadd_part_aoco_btree (id int, date date, amt decimal(10,2)) with (appendonly=true, orientation=column) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE
Insert into reindex_crtabforalter_part_aoco_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_aoco_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_aoco_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_aoco_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_aoco_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_aoco_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_aoco_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_aoco_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
INSERT 21
create index idx_reindex_crtabforalter_part_aoco_btree on reindex_crtabforalter_part_aoco_btree(id);
create index idx_reindex_crtabforadd_part_aoco_btree on reindex_crtabforadd_part_aoco_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforadd_part_aoco_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_aoco_btree%';
CREATE 8
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforadd_part_aoco_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
---------------------------------------------------------+------------------------
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_jul13|1
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_aug13|1
idx_reindex_crtabforadd_part_aoco_btree |1
idx_reindex_crtabforadd_part_aoco_btree_1_prt_sales_sep13|1
(4 rows)
......@@ -2,24 +2,24 @@
-- @Description Ensures that a reindex table during alter tab add partition operations is ok
--
DELETE FROM reindex_crtabforalter_part_heap_btree WHERE id < 12;
DELETE FROM reindex_crtabforadd_part_heap_btree WHERE id < 12;
DELETE 8
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtabforalter_part_heap_btree;
1: REINDEX TABLE reindex_crtabforadd_part_heap_btree;
REINDEX
2&: alter table reindex_crtabforalter_part_heap_btree add partition new_p START (date '2013-06-01') INCLUSIVE ; <waiting ...>
2&: alter table reindex_crtabforadd_part_heap_btree add partition new_p START (date '2013-06-01') INCLUSIVE ; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: Insert into reindex_crtabforalter_part_heap_btree values(29,'2013-06-09',14.20);
3: Insert into reindex_crtabforadd_part_heap_btree values(29,'2013-06-09',14.20);
INSERT 1
3: select count(*) from reindex_crtabforalter_part_heap_btree where id = 29;
3: select count(*) from reindex_crtabforadd_part_heap_btree where id = 29;
count
-----
5
......@@ -28,57 +28,28 @@ count
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtabforalter_part_heap_btree where id = 29;
3: select count(*) from reindex_crtabforadd_part_heap_btree where id = 29;
count
-----
5
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforadd_part_heap_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_heap_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
---------------------------------------------------------+---------------------
idx_reindex_crtabforadd_part_heap_btree |1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_aug13|1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_sep13|1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_jul13|1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_heap_btree_1_prt_new_p' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_data
---------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_new_p' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_data
-----------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_new_p_id_key' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_new_idx
----------------------------------------------
1
3: select 1 AS oid_same_on_all_segs_partition_new_idx from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforadd_part_heap_btree_1_prt_new_p_id_key' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
oid_same_on_all_segs_partition_new_idx
--------------------------------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtabforalter_part_heap_btree;
DROP TABLE IF EXISTS reindex_crtabforadd_part_heap_btree;
DROP
CREATE TABLE reindex_crtabforalter_part_heap_btree (id int, date date, amt decimal(10,2)) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE TABLE reindex_crtabforadd_part_heap_btree (id int, date date, amt decimal(10,2)) DISTRIBUTED BY (id) PARTITION BY RANGE (date) ( PARTITION sales_Jul13 START (date '2013-07-01') INCLUSIVE , PARTITION sales_Aug13 START (date '2013-08-01') INCLUSIVE , PARTITION sales_Sep13 START (date '2013-09-01') INCLUSIVE END (date '2014-01-01') EXCLUSIVE );
CREATE
Insert into reindex_crtabforalter_part_heap_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_heap_btree select i, to_date('2013-07-'||i, 'YYYY/MM/DD') , 19.21+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_heap_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_heap_btree select i, to_date('2013-08-'||i, 'YYYY/MM/DD') , 9.31+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_heap_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_heap_btree select i, to_date('2013-09-'||i, 'YYYY/MM/DD') , 12.25+i from generate_series(10,30) i;
INSERT 21
Insert into reindex_crtabforalter_part_heap_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
Insert into reindex_crtabforadd_part_heap_btree select i, to_date('2013-11-'||i, 'YYYY/MM/DD') , 29.51+i from generate_series(10,30) i;
INSERT 21
create index idx_reindex_crtabforalter_part_heap_btree on reindex_crtabforalter_part_heap_btree(id);
create index idx_reindex_crtabforadd_part_heap_btree on reindex_crtabforadd_part_heap_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforadd_part_heap_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforadd_part_heap_btree%';
CREATE 8
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforadd_part_heap_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
---------------------------------------------------------+------------------------
idx_reindex_crtabforadd_part_heap_btree |1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_aug13|1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_sep13|1
idx_reindex_crtabforadd_part_heap_btree_1_prt_sales_jul13|1
(4 rows)
......@@ -31,43 +31,16 @@ count
-----
4
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforalter_part_ao_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_ao_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
---------------------------------------------------------+---------------------
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13|1
idx_reindex_crtabforalter_part_ao_btree |1
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13|1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
3: select count(*) from pg_attribute where attname = 'amt' and attrelid = (select oid from pg_class where relname = 'reindex_crtabforalter_part_ao_btree');
count
-----
......
......@@ -17,41 +17,16 @@ INSERT 21
create index idx_reindex_crtabforalter_part_ao_btree on reindex_crtabforalter_part_ao_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforalter_part_ao_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_ao_btree%';
ERROR: relation "before_reindex_crtabforalter_part_ao_btree" already exists
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforalter_part_ao_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
---------------------------------------------------------+------------------------
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_sep13|1
idx_reindex_crtabforalter_part_ao_btree |1
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_ao_btree_1_prt_sales_aug13|1
(4 rows)
......@@ -31,43 +31,16 @@ count
-----
4
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforalter_part_aoco_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_aoco_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
-----------------------------------------------------------+---------------------
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13|1
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13|1
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_aoco_btree |1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
3: select count(*) from pg_attribute where attname = 'amt' and attrelid = (select oid from pg_class where relname = 'reindex_crtabforalter_part_aoco_btree');
count
-----
......
......@@ -17,41 +17,16 @@ INSERT 21
create index idx_reindex_crtabforalter_part_aoco_btree on reindex_crtabforalter_part_aoco_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforalter_part_aoco_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_aoco_btree%';
CREATE 8
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforalter_part_aoco_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
-----------------------------------------------------------+------------------------
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_aug13|1
idx_reindex_crtabforalter_part_aoco_btree |1
idx_reindex_crtabforalter_part_aoco_btree_1_prt_sales_sep13|1
(4 rows)
......@@ -31,43 +31,16 @@ count
-----
4
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_crtabforalter_part_heap_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_heap_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
-----------------------------------------------------------+---------------------
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13|1
idx_reindex_crtabforalter_part_heap_btree |1
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13|1
(4 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
3: select count(*) from pg_attribute where attname = 'amt' and attrelid = (select oid from pg_class where relname = 'reindex_crtabforalter_part_heap_btree');
count
-----
......
......@@ -17,41 +17,16 @@ INSERT 21
create index idx_reindex_crtabforalter_part_heap_btree on reindex_crtabforalter_part_heap_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_3_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_3_idx
--------------------------------------------
1
(1 row)
-- start_ignore
create table before_reindex_crtabforalter_part_heap_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_crtabforalter_part_heap_btree%';
CREATE 8
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_crtabforalter_part_heap_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
-----------------------------------------------------------+------------------------
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_sep13|1
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_jul13|1
idx_reindex_crtabforalter_part_heap_btree |1
idx_reindex_crtabforalter_part_heap_btree_1_prt_sales_aug13|1
(4 rows)
......@@ -2,22 +2,22 @@
-- @Description Ensures that a reindex table during reindex index operations is ok
--
DELETE FROM reindex_crtab_part_ao_btree WHERE id < 128;
DELETE FROM reindex_dropindex_crtab_part_ao_btree WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtab_part_ao_btree;
1: REINDEX TABLE reindex_dropindex_crtab_part_ao_btree;
REINDEX
2&: DROP INDEX idx_reindex_crtab_part_owner_ao_btree; <waiting ...>
2&: DROP INDEX idx_reindex_dropindex_crtab_part_owner_ao_btree; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: select count(*) from reindex_crtab_part_ao_btree where id = 998;
3: select count(*) from reindex_dropindex_crtab_part_ao_btree where id = 998;
count
-----
2
......@@ -26,52 +26,23 @@ count
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtab_part_ao_btree where id = 999;
3: select count(*) from reindex_dropindex_crtab_part_ao_btree where id = 999;
count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_dropindex_crtab_part_ao_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_ao_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
--------------------------------------------------------+---------------------
idx_reindex_dropindex_crtab_part_ao_btree |1
idx_reindex_dropindex_crtab_part_ao_btree_1_prt_de_fault|1
idx_reindex_dropindex_crtab_part_ao_btree_1_prt_p_one |1
(3 rows)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_ao_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
(0 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_ao_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
-- expect only the index on parent table to be dropped; drop index will not drop indexes on child partitions
3: select 1-count(1) as index_dropped from (select * from pg_class union all select * from gp_dist_random('pg_class')) t where t.relname = 'idx_reindex_dropindex_crtab_part_owner_ao_btree';
index_dropped
-------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtab_part_ao_btree;
DROP
CREATE TABLE reindex_crtab_part_ao_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ') with (appendonly=true) DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE TABLE reindex_dropindex_crtab_part_ao_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ') with (appendonly=true) DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE
insert into reindex_crtab_part_ao_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_ao_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
insert into reindex_crtab_part_ao_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_ao_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
create index idx_reindex_crtab_part_ao_btree on reindex_crtab_part_ao_btree(id);
create index idx_reindex_dropindex_crtab_part_ao_btree on reindex_dropindex_crtab_part_ao_btree(id);
CREATE
create index idx_reindex_crtab_part_owner_ao_btree on reindex_crtab_part_ao_btree(owner);
create index idx_reindex_dropindex_crtab_part_owner_ao_btree on reindex_dropindex_crtab_part_ao_btree(owner);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
-- start_ignore
create table before_reindex_dropindex_crtab_part_ao_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_ao_btree%';
CREATE 6
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_dropindex_crtab_part_ao_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
--------------------------------------------------------+------------------------
idx_reindex_dropindex_crtab_part_ao_btree |1
idx_reindex_dropindex_crtab_part_ao_btree_1_prt_p_one |1
idx_reindex_dropindex_crtab_part_ao_btree_1_prt_de_fault|1
(3 rows)
select 1 AS index_exists_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_dropindex_crtab_part_owner_ao_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
index_exists_on_all_segs
------------------------
1
(1 row)
......@@ -2,22 +2,22 @@
-- @Description Ensures that a reindex table during reindex index operations is ok
--
DELETE FROM reindex_crtab_part_aoco_btree WHERE id < 128;
DELETE FROM reindex_dropindex_crtab_part_aoco_btree WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtab_part_aoco_btree;
1: REINDEX TABLE reindex_dropindex_crtab_part_aoco_btree;
REINDEX
2&: DROP INDEX idx_reindex_crtab_part_owner_aoco_btree; <waiting ...>
2&: DROP INDEX idx_reindex_dropindex_crtab_part_owner_aoco_btree; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: select count(*) from reindex_crtab_part_aoco_btree where id = 998;
3: select count(*) from reindex_dropindex_crtab_part_aoco_btree where id = 998;
count
-----
2
......@@ -26,52 +26,23 @@ count
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtab_part_aoco_btree where id = 999;
3: select count(*) from reindex_dropindex_crtab_part_aoco_btree where id = 999;
count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_dropindex_crtab_part_aoco_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_aoco_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
----------------------------------------------------------+---------------------
idx_reindex_dropindex_crtab_part_aoco_btree_1_prt_p_one |1
idx_reindex_dropindex_crtab_part_aoco_btree |1
idx_reindex_dropindex_crtab_part_aoco_btree_1_prt_de_fault|1
(3 rows)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_aoco_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
(0 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_aoco_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
-- expect only the index on parent table to be dropped; drop index will not drop indexes on child partitions
3: select 1-count(1) as index_dropped from (select * from pg_class union all select * from gp_dist_random('pg_class')) t where t.relname = 'idx_reindex_dropindex_crtab_part_owner_aoco_btree';
index_dropped
-------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtab_part_aoco_btree;
DROP
CREATE TABLE reindex_crtab_part_aoco_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ') with (appendonly=true, orientation=column) DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE TABLE reindex_dropindex_crtab_part_aoco_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ') with (appendonly=true, orientation=column) DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE
insert into reindex_crtab_part_aoco_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_aoco_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
insert into reindex_crtab_part_aoco_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_aoco_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
create index idx_reindex_crtab_part_aoco_btree on reindex_crtab_part_aoco_btree(id);
create index idx_reindex_dropindex_crtab_part_aoco_btree on reindex_dropindex_crtab_part_aoco_btree(id);
CREATE
create index idx_reindex_crtab_part_owner_aoco_btree on reindex_crtab_part_aoco_btree(owner);
create index idx_reindex_dropindex_crtab_part_owner_aoco_btree on reindex_dropindex_crtab_part_aoco_btree(owner);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
-- start_ignore
create table before_reindex_dropindex_crtab_part_aoco_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_aoco_btree%';
CREATE 6
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_dropindex_crtab_part_aoco_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
----------------------------------------------------------+------------------------
idx_reindex_dropindex_crtab_part_aoco_btree_1_prt_de_fault|1
idx_reindex_dropindex_crtab_part_aoco_btree |1
idx_reindex_dropindex_crtab_part_aoco_btree_1_prt_p_one |1
(3 rows)
select 1 AS index_exists_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_dropindex_crtab_part_owner_aoco_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
index_exists_on_all_segs
------------------------
1
(1 row)
......@@ -2,22 +2,22 @@
-- @Description Ensures that a reindex table during reindex index operations is ok
--
DELETE FROM reindex_crtab_part_heap_btree WHERE id < 128;
DELETE FROM reindex_dropindex_crtab_part_heap_btree WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX TABLE reindex_crtab_part_heap_btree;
1: REINDEX TABLE reindex_dropindex_crtab_part_heap_btree;
REINDEX
2&: DROP INDEX idx_reindex_crtab_part_owner_heap_btree; <waiting ...>
2&: DROP INDEX idx_reindex_dropindex_crtab_part_owner_heap_btree; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: select count(*) from reindex_crtab_part_heap_btree where id = 998;
3: select count(*) from reindex_dropindex_crtab_part_heap_btree where id = 998;
count
-----
2
......@@ -26,52 +26,23 @@ count
SET
3: set enable_indexscan=true;
SET
3: select count(*) from reindex_crtab_part_heap_btree where id = 999;
3: select count(*) from reindex_dropindex_crtab_part_heap_btree where id = 999;
count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select c_relname, 1 as different_relfilenode from before_reindex_dropindex_crtab_part_heap_btree b where exists (select oid, gp_segment_id, relfilenode from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_heap_btree%' and b.c_oid = oid and b.c_gp_segment_id = gp_segment_id and b.c_relfilenode != relfilenode) group by b.c_oid, b.c_relname;
c_relname |different_relfilenode
----------------------------------------------------------+---------------------
idx_reindex_dropindex_crtab_part_heap_btree |1
idx_reindex_dropindex_crtab_part_heap_btree_1_prt_p_one |1
idx_reindex_dropindex_crtab_part_heap_btree_1_prt_de_fault|1
(3 rows)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
(0 rows)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_heap_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
-- expect only the index on parent table to be dropped; drop index will not drop indexes on child partitions
3: select 1-count(1) as index_dropped from (select * from pg_class union all select * from gp_dist_random('pg_class')) t where t.relname = 'idx_reindex_dropindex_crtab_part_owner_heap_btree';
index_dropped
-------------
1
(1 row)
-- @product_version gpdb: [4.3.4.0 -],4.3.4.0O2
DROP TABLE IF EXISTS reindex_crtab_part_heap_btree;
DROP
CREATE TABLE reindex_crtab_part_heap_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ')DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE TABLE reindex_dropindex_crtab_part_heap_btree ( id INTEGER, owner VARCHAR, description VARCHAR, property BOX, poli POLYGON, target CIRCLE, v VARCHAR, t TEXT, f FLOAT, p POINT, c CIRCLE, filler VARCHAR DEFAULT 'Big data is difficult to work with using most relational database management systems and desktop statistics and visualization packages, requiring instead massively parallel software running on tens, hundreds, or even thousands of servers.What is considered big data varies depending on the capabilities of the organization managing the set, and on the capabilities of the applications.This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. ')DISTRIBUTED BY (id) PARTITION BY RANGE (id) ( PARTITION p_one START('1') INCLUSIVE END ('10') EXCLUSIVE, DEFAULT PARTITION de_fault );
CREATE
insert into reindex_crtab_part_heap_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_heap_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
insert into reindex_crtab_part_heap_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
insert into reindex_dropindex_crtab_part_heap_btree (id, owner, description, property, poli, target) select i, 'user' || i, 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)' from generate_series(1,1000) i ;
INSERT 1000
create index idx_reindex_crtab_part_heap_btree on reindex_crtab_part_heap_btree(id);
create index idx_reindex_dropindex_crtab_part_heap_btree on reindex_dropindex_crtab_part_heap_btree(id);
CREATE
create index idx_reindex_crtab_part_owner_heap_btree on reindex_crtab_part_heap_btree(owner);
create index idx_reindex_dropindex_crtab_part_owner_heap_btree on reindex_dropindex_crtab_part_heap_btree(owner);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_owner_heap_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_heap_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_heap_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
-- start_ignore
create table before_reindex_dropindex_crtab_part_heap_btree as select oid as c_oid, gp_segment_id as c_gp_segment_id, relfilenode as c_relfilenode, relname as c_relname from gp_dist_random('pg_class') where relname like 'idx_reindex_dropindex_crtab_part_heap_btree%';
CREATE 6
-- end_ignore
select c_relname, 1 as have_same_number_of_rows from before_reindex_dropindex_crtab_part_heap_btree group by c_oid, c_relname having count(*) = (select count(*) from gp_segment_configuration where role = 'p' and content > -1);
c_relname |have_same_number_of_rows
----------------------------------------------------------+------------------------
idx_reindex_dropindex_crtab_part_heap_btree_1_prt_de_fault|1
idx_reindex_dropindex_crtab_part_heap_btree |1
idx_reindex_dropindex_crtab_part_heap_btree_1_prt_p_one |1
(3 rows)
select 1 AS index_exists_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_dropindex_crtab_part_owner_heap_btree' GROUP BY oid having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
index_exists_on_all_segs
------------------------
1
(1 row)
......@@ -30,14 +30,17 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select sum(relfilenode_updated_twice)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_twice from (select (count(*)/3) as relfilenode_updated_twice from (select gp_segment_id, oid, * from pg_class union all select gp_segment_id, oid, * from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_ao_bitmap' group by gp_segment_id, oid) per_seg_filenode_updated;
all_segs_reindexed_twice
------------------------
1
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -9,9 +9,3 @@ insert into reindex_crtab_ao_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_ao_bitmap on reindex_crtab_ao_bitmap USING BITMAP(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -30,14 +30,17 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select sum(relfilenode_updated_twice)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_twice from (select (count(*)/3) as relfilenode_updated_twice from (select gp_segment_id, oid, * from pg_class union all select gp_segment_id, oid, * from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_ao_btree' group by gp_segment_id, oid) per_seg_filenode_updated;
all_segs_reindexed_twice
------------------------
1
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -9,9 +9,3 @@ insert into reindex_crtab_ao_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_ao_btree on reindex_crtab_ao_btree(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_btree' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -32,14 +32,17 @@ count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_ao_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_ao_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select sum(relfilenode_updated_twice)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_twice from (select (count(*)/3) as relfilenode_updated_twice from (select gp_segment_id, oid, * from pg_class union all select gp_segment_id, oid, * from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_ao_gist' group by gp_segment_id, oid) per_seg_filenode_updated;
all_segs_reindexed_twice
------------------------
1
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -11,9 +11,3 @@ insert into reindex_crtab_ao_gist (id, box1) VALUES (304, '( (2, 2), (4, 4) )');
INSERT 1
create index idx_reindex_crtab_ao_gist on reindex_crtab_ao_gist USING Gist(box1);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_ao_gist' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_ao_bitmap%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
-----------------------------------------------+------------------------
idx_reindex_crtab_part_ao_bitmap_1_prt_de_fault|2
idx_reindex_crtab_part_ao_bitmap_1_prt_p_one |1
idx_reindex_crtab_part_ao_bitmap |1
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_ao_bitmap (id, owner, description, property, poli
INSERT 1000
create index idx_reindex_crtab_part_ao_bitmap on reindex_crtab_part_ao_bitmap USING BITMAP(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_ao_btree%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
----------------------------------------------+------------------------
idx_reindex_crtab_part_ao_btree |1
idx_reindex_crtab_part_ao_btree_1_prt_de_fault|2
idx_reindex_crtab_part_ao_btree_1_prt_p_one |1
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_ao_btree (id, owner, description, property, poli,
INSERT 1000
create index idx_reindex_crtab_part_ao_btree on reindex_crtab_part_ao_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_ao_gist%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
---------------------------------------------+------------------------
idx_reindex_crtab_part_ao_gist_1_prt_p_one |1
idx_reindex_crtab_part_ao_gist |1
idx_reindex_crtab_part_ao_gist_1_prt_de_fault|2
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_ao_gist (id, owner, description, property, poli,
INSERT 1000
create index idx_reindex_crtab_part_ao_gist on reindex_crtab_part_ao_gist USING GIST(target);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_ao_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_ao_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -30,14 +30,17 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_aoco_bitmap' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
-----------------------------+------------------------
idx_reindex_crtab_aoco_bitmap|2
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -9,9 +9,3 @@ insert into reindex_crtab_aoco_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_aoco_bitmap on reindex_crtab_aoco_bitmap USING BITMAP(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -30,14 +30,17 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_aoco_btree' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
----------------------------+------------------------
idx_reindex_crtab_aoco_btree|2
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -9,9 +9,3 @@ insert into reindex_crtab_aoco_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_aoco_btree on reindex_crtab_aoco_btree(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_btree' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -32,14 +32,17 @@ count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_aoco_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_aoco_gist' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_aoco_gist' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
---------------------------+------------------------
idx_reindex_crtab_aoco_gist|2
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -11,9 +11,3 @@ insert into reindex_crtab_aoco_gist (id, box1) VALUES (304, '( (2, 2), (4, 4) )'
INSERT 1
create index idx_reindex_crtab_aoco_gist on reindex_crtab_aoco_gist USING Gist(box1);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_aoco_gist' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_aoco_bitmap%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
-------------------------------------------------+------------------------
idx_reindex_crtab_part_aoco_bitmap_1_prt_de_fault|2
idx_reindex_crtab_part_aoco_bitmap |1
idx_reindex_crtab_part_aoco_bitmap_1_prt_p_one |1
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_aoco_bitmap (id, owner, description, property, po
INSERT 1000
create index idx_reindex_crtab_part_aoco_bitmap on reindex_crtab_part_aoco_bitmap USING BITMAP(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_bitmap_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_aoco_btree%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
------------------------------------------------+------------------------
idx_reindex_crtab_part_aoco_btree_1_prt_p_one |1
idx_reindex_crtab_part_aoco_btree_1_prt_de_fault|2
idx_reindex_crtab_part_aoco_btree |1
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_aoco_btree (id, owner, description, property, pol
INSERT 1000
create index idx_reindex_crtab_part_aoco_btree on reindex_crtab_part_aoco_btree(id);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_btree_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -31,38 +31,19 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist_1_prt_de_fault' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
3: select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist_1_prt_p_one' and relfilenode != oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname like 'idx_reindex_crtab_part_aoco_gist%' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
-----------------------------------------------+------------------------
idx_reindex_crtab_part_aoco_gist_1_prt_p_one |1
idx_reindex_crtab_part_aoco_gist |1
idx_reindex_crtab_part_aoco_gist_1_prt_de_fault|2
(3 rows)
3: set gp_select_invisible=off;
SET
......@@ -10,42 +10,3 @@ insert into reindex_crtab_part_aoco_gist (id, owner, description, property, poli
INSERT 1000
create index idx_reindex_crtab_part_aoco_gist on reindex_crtab_part_aoco_gist USING GIST(target);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs_maintable from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_maintable
--------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_mainidx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_mainidx
------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_data
---------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_default_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist_1_prt_de_fault' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_default_idx
--------------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_data from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_part_aoco_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_data
---------------------------------------------
1
(1 row)
select 1 AS relfilenode_same_on_all_segs_partition_1_idx from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_part_aoco_gist_1_prt_p_one' and relfilenode = oid GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs_partition_1_idx
--------------------------------------------
1
(1 row)
......@@ -30,14 +30,17 @@ count
-----
2
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_crtab_heap_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'reindex_crtab_heap_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
SET
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_heap_bitmap' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
relname |all_segs_reindexed_count
-----------------------------+------------------------
idx_reindex_crtab_heap_bitmap|2
(1 row)
3: set gp_select_invisible=off;
SET
......@@ -7,9 +7,3 @@ insert into reindex_crtab_heap_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_crtab_heap_bitmap on reindex_crtab_heap_bitmap USING BITMAP(a);
CREATE
select 1 as relfilenode_same_on_all_segs from gp_dist_random('pg_class') where relname = 'idx_reindex_crtab_heap_bitmap' group by relfilenode having count(*) = (select count(*) from gp_segment_configuration where role='p' and content > -1);
relfilenode_same_on_all_segs
----------------------------
1
(1 row)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册