提交 8c3850fd 编写于 作者: H Heikki Linnakangas

Remove tests on REINDEX and TRUNCATE/ALTER/DROP TABLE running in parallel.

REINDEX grabs a ShareLock on the table relation very early on, and
TRUNCATE grabs an AccessExclusiveLock very early on. If we trust that the
lock manager isn't broken, there's no need to test this combination of
commands in particular. (For testing the lock manager, these tests give
only very narrow coverage.) Furthermore, all these test cases are
effectively the same, as it it makes no difference what kind of a table or
what kind of an index it is, the locking works the same for all.

ALTER and DROP TABLE also grab an AccessExclusiveLock on the table, which
conflicts with the ShareLock that REINDEX takes. It works the same with all
flavors of ALTER and DROP TABLE, and with all kinds of tables, and all
kinds of indexes.
上级 9a8b5010
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_ao_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_ao_bitmap drop column j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_ao_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_ao_bitmap WHERE a = 2500;
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_ao_bitmap;
DROP
CREATE TABLE reindex_alter_ao_bitmap (a INT,j INT) WITH (appendonly=true);
CREATE
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create INDEX idx_reindex_alter_ao_bitmap ON reindex_alter_ao_bitmap USING bitmap(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_alter_ao_btree;
REINDEX
2&: alter table reindex_alter_ao_btree drop column j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_ao_btree VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_ao_btree WHERE a = 2500;
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_ao_btree;
DROP
CREATE TABLE reindex_alter_ao_btree (a INT,j INT) WITH (appendonly=true);
CREATE
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
CREATE INDEX idx_reindex_alter_ao_btree on reindex_alter_ao_btree(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_aoco_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_aoco_bitmap drop column j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_aoco_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_aoco_bitmap WHERE a = 2500;
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_aoco_bitmap;
DROP
CREATE TABLE reindex_alter_aoco_bitmap (a INT, j INT) WITH (appendonly=true, orientation=column);
CREATE
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_aoco_bitmap on reindex_alter_aoco_bitmap USING bitmap(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_aoco_btree;
REINDEX
2&: ALTER TABLE reindex_alter_aoco_btree drop column j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_aoco_btree VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_aoco_btree;
DROP
CREATE TABLE reindex_alter_aoco_btree (a INT, j INT) WITH (appendonly=true, orientation=column);
CREATE
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_aoco_btree on reindex_alter_aoco_btree(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_heap_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_heap_bitmap drop COLUMN j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_heap_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_heap_bitmap where a = 2500;
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_bitmap' GROUP BY relfilenode HAVING count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_heap_bitmap;
DROP
CREATE TABLE reindex_alter_heap_bitmap (a INT, j INT); insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
CREATE 1000
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_heap_bitmap on reindex_alter_heap_bitmap USING bitmap(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_alter_heap_btree;
REINDEX
2&: alter table reindex_alter_heap_btree drop column j; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_alter_heap_btree';
count
-----
1
(1 row)
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
relfilenode_same_on_all_segs
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_alter_heap_btree;
DROP
CREATE TABLE reindex_alter_heap_btree (a INT, j INT); insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
CREATE 1000
insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_heap_btree on reindex_alter_heap_btree(j);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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
(1 row)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_ao_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_ao;
REINDEX
2&: alter table reindex_ao_gist drop column target; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_ao_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57 , 650), (68, 660) )') ;
INSERT 1
3: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_ao_gist;
DROP
CREATE TABLE reindex_ao_gist ( 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_ao_gist (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_ao_gist (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_gist_reindex_ao on reindex_ao_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_ao' 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)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_aoco_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_aoco;
REINDEX
2&: alter table reindex_aoco_gist drop column target; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_aoco_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )') ;
INSERT 1
3: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_aoco_gist;
DROP
CREATE TABLE reindex_aoco_gist ( 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_aoco_gist (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_aoco_gist (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_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
(1 row)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_heap_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_heap;
REINDEX
2&: alter table reindex_heap_gist drop column target; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_heap_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57,650), (68, 660) )');
INSERT 1
3: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_heap_gist;
DROP
CREATE TABLE reindex_heap_gist ( 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_heap_gist (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_heap_gist (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_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
(1 row)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_ao_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_ao_bitmap alter column j type numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_ao_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_ao_bitmap WHERE a = 2500;
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_ao_bitmap;
DROP
CREATE TABLE reindex_alter_ao_bitmap (a INT,j INT) WITH (appendonly=true);
CREATE
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create INDEX idx_reindex_alter_ao_bitmap ON reindex_alter_ao_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_alter_ao_btree;
REINDEX
2&: alter table reindex_alter_ao_btree alter column j type numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_ao_btree VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_ao_btree WHERE a = 2500;
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_ao_btree;
DROP
CREATE TABLE reindex_alter_ao_btree (a INT,j INT) WITH (appendonly=true);
CREATE
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
CREATE INDEX idx_reindex_alter_ao_btree on reindex_alter_ao_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_aoco_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_aoco_bitmap alter column j type numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_aoco_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_aoco_bitmap WHERE a = 2500;
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_aoco_bitmap;
DROP
CREATE TABLE reindex_alter_aoco_bitmap (a INT, j INT) WITH (appendonly=true, orientation=column);
CREATE
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_aoco_bitmap on reindex_alter_aoco_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_aoco_btree;
REINDEX
2&: ALTER TABLE reindex_alter_aoco_btree alter column j type numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_aoco_btree VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
count
-----
1
(1 row)
3: set enable_seqscan=false;
SET
3: set enable_indexscan=true;
SET
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_aoco_btree;
DROP
CREATE TABLE reindex_alter_aoco_btree (a INT, j INT) WITH (appendonly=true, orientation=column);
CREATE
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_aoco_btree on reindex_alter_aoco_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX INDEX idx_reindex_alter_heap_bitmap;
REINDEX
2&: ALTER TABLE reindex_alter_heap_bitmap ALTER COLUMN j TYPE numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: INSERT INTO reindex_alter_heap_bitmap VALUES(2500);
INSERT 1
3: SELECT count(*) FROM reindex_alter_heap_bitmap where a = 2500;
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_heap_bitmap;
DROP
CREATE TABLE reindex_alter_heap_bitmap (a INT, j INT); insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
CREATE 1000
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_heap_bitmap on reindex_alter_heap_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_alter_heap_btree;
REINDEX
2&: alter table reindex_alter_heap_btree alter column j type numeric; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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
(1 row)
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_alter_heap_btree';
count
-----
1
(1 row)
DROP TABLE IF EXISTS reindex_alter_heap_btree;
DROP
CREATE TABLE reindex_alter_heap_btree (a INT, j INT); insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
CREATE 1000
insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
INSERT 1000
create index idx_reindex_alter_heap_btree on reindex_alter_heap_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_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
(1 row)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_ao_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_ao;
REINDEX
2&: alter table reindex_ao_gist alter column owner type char(255); <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_ao_gist (id, owner, description, property, poli, target) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57 , 650), (68, 660) )', '( (76, 76), 76)') ;
INSERT 1
3: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
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
(1 row)
DROP TABLE IF EXISTS reindex_ao_gist;
DROP
CREATE TABLE reindex_ao_gist ( 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_ao_gist (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_ao_gist (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_gist_reindex_ao on reindex_ao_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_ao' 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)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_aoco_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_aoco;
REINDEX
2&: alter table reindex_aoco_gist alter column owner type char(255); <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_aoco_gist (id, owner, description, property, poli, target) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )', '( (76, 76), 76)') ;
INSERT 1
3: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
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
(1 row)
DROP TABLE IF EXISTS reindex_aoco_gist;
DROP
CREATE TABLE reindex_aoco_gist ( 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_aoco_gist (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_aoco_gist (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_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
(1 row)
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_heap_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_heap;
REINDEX
2&: alter table reindex_heap_gist alter column owner type char(255); <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
ALTER
2: COMMIT;
COMMIT
3: insert into reindex_heap_gist (id, owner, description, property, poli, target) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57,650), (68, 660) )', '( (76, 76), 76)'); 3: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
INSERT 1
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
(1 row)
DROP TABLE IF EXISTS reindex_heap_gist;
DROP
CREATE TABLE reindex_heap_gist ( 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_heap_gist (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_heap_gist (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_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
(1 row)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_ao_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_ao_bitmap;
REINDEX
2&: drop table reindex_drop_ao_bitmap; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_ao_bitmap';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_ao_bitmap;
DROP
CREATE TABLE reindex_drop_ao_bitmap (a INT) WITH (appendonly=true);
CREATE
insert into reindex_drop_ao_bitmap select generate_series(1,1000);
INSERT 1000
insert into reindex_drop_ao_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_ao_bitmap on reindex_drop_ao_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_ao_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_ao_btree;
REINDEX
2&: drop table reindex_drop_ao_btree; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_ao_btree';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_ao_btree;
DROP
CREATE TABLE reindex_drop_ao_btree (a INT) WITH (appendonly=true);
CREATE
insert into reindex_drop_ao_btree select generate_series(1,1000);
INSERT 1000
insert into reindex_drop_ao_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_ao_btree on reindex_drop_ao_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_aoco_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_aoco_bitmap;
REINDEX
2&: drop table reindex_drop_aoco_bitmap; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_aoco_bitmap';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_aoco_bitmap;
DROP
CREATE TABLE reindex_drop_aoco_bitmap (a INT) WITH (appendonly=true, orientation=column);
CREATE
insert into reindex_drop_aoco_bitmap select generate_series(1,1000);
INSERT 1000
insert into reindex_drop_aoco_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_aoco_bitmap on reindex_drop_aoco_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_aoco_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_aoco_btree;
REINDEX
2&: drop table reindex_drop_aoco_btree; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_aoco_btree';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_aoco_btree;
DROP
CREATE TABLE reindex_drop_aoco_btree (a INT) WITH (appendonly=true, orientation=column);
CREATE
insert into reindex_drop_aoco_btree select generate_series(1,1000);
INSERT 1000
insert into reindex_drop_aoco_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_aoco_btree on reindex_drop_aoco_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_heap_bitmap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_heap_bitmap;
REINDEX
2&: drop table reindex_drop_heap_bitmap; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_heap_bitmap';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_heap_bitmap;
DROP
CREATE TABLE reindex_drop_heap_bitmap (a INT); insert into reindex_drop_heap_bitmap select generate_series(1,1000);
CREATE 1000
insert into reindex_drop_heap_bitmap select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_heap_bitmap on reindex_drop_heap_bitmap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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)
-- @Description Ensures that a drop table during reindex operations is ok
--
DELETE FROM reindex_drop_heap_btree WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
2: BEGIN;
BEGIN
1: REINDEX index idx_reindex_drop_heap_btree;
REINDEX
2&: drop table reindex_drop_heap_btree; <waiting ...>
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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
(1 row)
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_drop_heap_btree';
count
-----
0
(1 row)
DROP TABLE IF EXISTS reindex_drop_heap_btree;
DROP
CREATE TABLE reindex_drop_heap_btree (a INT); insert into reindex_drop_heap_btree select generate_series(1,1000);
CREATE 1000
insert into reindex_drop_heap_btree select generate_series(1,1000);
INSERT 1000
create index idx_reindex_drop_heap_btree on reindex_drop_heap_btree(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_drop_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
(1 row)
-- @Description Ensures that a drop table during reindex operations on GiST index is ok
--
DELETE FROM reindex_ao_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_ao;
REINDEX
2&: drop table reindex_ao_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
ERROR: relation "reindex_ao_gist" does not exist
LINE 1: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
^
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_ao_gist;
DROP
CREATE TABLE reindex_ao_gist ( 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_ao_gist (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_ao_gist (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_gist_reindex_ao on reindex_ao_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_ao' 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)
-- @Description Ensures that a drop table during reindex operations on GiST index is ok
--
DELETE FROM reindex_aoco_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_aoco;
REINDEX
2&: drop table reindex_aoco_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
ERROR: relation "reindex_aoco_gist" does not exist
LINE 1: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
^
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_aoco_gist;
DROP
CREATE TABLE reindex_aoco_gist ( 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_aoco_gist (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_aoco_gist (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_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
(1 row)
-- @Description Ensures that a drop table during reindex operations on GiST index is ok
--
DELETE FROM reindex_heap_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_heap;
REINDEX
2&: drop table reindex_heap_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
DROP
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
ERROR: relation "reindex_heap_gist" does not exist
LINE 1: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
^
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
----------------------------
(0 rows)
DROP TABLE IF EXISTS reindex_heap_gist;
DROP
CREATE TABLE reindex_heap_gist ( 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_heap_gist (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_heap_gist (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_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
(1 row)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_ao WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_bitmap_reindex_ao;
REINDEX
2&: TRUNCATE TABLE reindex_ao; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_ao where a > 128 ;
count
-----
0
(1 row)
3: set enable_seqscan=false;
SET
3: set enable_indexscan=true;
SET
3: SELECT COUNT(*) FROM reindex_ao where a > 128 ;
count
-----
0
(1 row)
3: INSERT INTO reindex_ao VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
DROP TABLE IF EXISTS reindex_ao;
DROP
CREATE TABLE reindex_ao (a INT) WITH (appendonly=true);
CREATE
insert into reindex_ao select generate_series(1,1000);
INSERT 1000
insert into reindex_ao select generate_series(1,1000);
INSERT 1000
create index idx_bitmap_reindex_ao on reindex_ao USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_ao WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_btree_reindex_ao;
REINDEX
2&: TRUNCATE TABLE reindex_ao; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_ao ;
count
-----
0
(1 row)
3: INSERT INTO reindex_ao VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
DROP TABLE IF EXISTS reindex_ao;
DROP
CREATE TABLE reindex_ao (a INT) WITH (appendonly=true);
CREATE
insert into reindex_ao select generate_series(1,1000);
INSERT 1000
insert into reindex_ao select generate_series(1,1000);
INSERT 1000
create index idx_btree_reindex_ao on reindex_ao(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
-- @Description Ensures that a truncate during reindex operations on GiST index is ok
--
DELETE FROM reindex_ao_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_ao;
REINDEX
2&: TRUNCATE TABLE reindex_ao_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
count
-----
0
(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
(1 row)
DROP TABLE IF EXISTS reindex_ao_gist;
DROP
CREATE TABLE reindex_ao_gist ( 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_ao_gist (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_ao_gist (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_gist_reindex_ao on reindex_ao_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_ao' 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)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_aoco WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_bitmap_reindex_aoco;
REINDEX
2&: TRUNCATE TABLE reindex_aoco; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_aoco ;
count
-----
0
(1 row)
3: INSERT INTO reindex_aoco VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
DROP TABLE IF EXISTS reindex_aoco;
DROP
CREATE TABLE reindex_aoco (a INT) WITH (appendonly=true, orientation=column);
CREATE
insert into reindex_aoco select generate_series(1,1000);
INSERT 1000
insert into reindex_aoco select generate_series(1,1000);
INSERT 1000
create index idx_bitmap_reindex_aoco on reindex_aoco USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_aoco WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_btree_reindex_aoco;
REINDEX
2&: TRUNCATE TABLE reindex_aoco; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_aoco ;
count
-----
0
(1 row)
3: INSERT INTO reindex_aoco VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
DROP TABLE IF EXISTS reindex_aoco;
DROP
CREATE TABLE reindex_aoco (a INT) WITH (appendonly=true, orientation=column);
CREATE
insert into reindex_aoco select generate_series(1,1000);
INSERT 1000
insert into reindex_aoco select generate_series(1,1000);
INSERT 1000
create index idx_btree_reindex_aoco on reindex_aoco(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
-- @Description Ensures that a truncate during reindex operations on GiST index is ok
--
DELETE FROM reindex_aoco_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_aoco;
REINDEX
2&: TRUNCATE TABLE reindex_aoco_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
count
-----
0
(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
(1 row)
DROP TABLE IF EXISTS reindex_aoco_gist;
DROP
CREATE TABLE reindex_aoco_gist ( 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_aoco_gist (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_aoco_gist (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_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
(1 row)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_heap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_bitmap_reindex_heap;
REINDEX
2&: TRUNCATE TABLE reindex_heap; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_heap ;
count
-----
0
(1 row)
3: INSERT INTO reindex_heap VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
DROP TABLE IF EXISTS reindex_heap;
DROP
CREATE TABLE reindex_heap (a INT);
CREATE
insert into reindex_heap select generate_series(1,1000);
INSERT 1000
insert into reindex_heap select generate_series(1,1000);
INSERT 1000
create index idx_bitmap_reindex_heap on reindex_heap USING bitmap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_bitmap_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
(1 row)
-- @Description Ensures that a trucate during reindex operations is ok
--
DELETE FROM reindex_heap WHERE a < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_btree_reindex_heap;
REINDEX
2&: TRUNCATE TABLE reindex_heap; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_heap ;
count
-----
0
(1 row)
3: INSERT INTO reindex_heap VALUES (0);
INSERT 1
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
DROP TABLE IF EXISTS reindex_heap;
DROP
CREATE TABLE reindex_heap (a INT);
CREATE
insert into reindex_heap select generate_series(1,1000);
INSERT 1000
insert into reindex_heap select generate_series(1,1000);
INSERT 1000
create index idx_btree_reindex_heap on reindex_heap(a);
CREATE
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_btree_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
(1 row)
-- @Description Ensures that a truncate during reindex operations on GiST index is ok
--
DELETE FROM reindex_heap_gist WHERE id < 128;
DELETE 254
1: BEGIN;
BEGIN
1: REINDEX index idx_gist_reindex_heap;
REINDEX
2&: TRUNCATE TABLE reindex_heap_gist; <waiting ...>
1: COMMIT;
COMMIT
2<: <... completed>
TRUNCATE
2: COMMIT;
COMMIT
3: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
count
-----
0
(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
(1 row)
DROP TABLE IF EXISTS reindex_heap_gist;
DROP
CREATE TABLE reindex_heap_gist ( 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_heap_gist (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_heap_gist (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_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
(1 row)
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_ao_bitmap;
2&: ALTER TABLE reindex_alter_ao_bitmap drop column j;
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_ao_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_ao_bitmap WHERE a = 2500;
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_ao_bitmap;
CREATE TABLE reindex_alter_ao_bitmap (a INT,j INT) WITH (appendonly=true);
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create INDEX idx_reindex_alter_ao_bitmap ON reindex_alter_ao_bitmap USING bitmap(j);
SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_bitmap' GROUP BY relfilenode HAVING count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_btree WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX index idx_reindex_alter_ao_btree;
2&: alter table reindex_alter_ao_btree drop column j;
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_ao_btree VALUES(2500);
3: SELECT count(*) FROM reindex_alter_ao_btree WHERE a = 2500;
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_ao_btree;
CREATE TABLE reindex_alter_ao_btree (a INT,j INT) WITH (appendonly=true);
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
CREATE INDEX idx_reindex_alter_ao_btree on reindex_alter_ao_btree(j);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_aoco_bitmap;
2&: ALTER TABLE reindex_alter_aoco_bitmap drop column j;
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_aoco_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_aoco_bitmap WHERE a = 2500;
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_aoco_bitmap;
CREATE TABLE reindex_alter_aoco_bitmap (a INT, j INT) WITH (appendonly=true, orientation=column);
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_aoco_bitmap on reindex_alter_aoco_bitmap USING bitmap(j);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_btree WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_aoco_btree;
2&: ALTER TABLE reindex_alter_aoco_btree drop column j;
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_aoco_btree VALUES(2500);
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_aoco_btree;
CREATE TABLE reindex_alter_aoco_btree (a INT, j INT) WITH (appendonly=true, orientation=column);
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_aoco_btree on reindex_alter_aoco_btree(j);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_heap_bitmap;
2&: ALTER TABLE reindex_alter_heap_bitmap drop COLUMN j;
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_heap_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_heap_bitmap where a = 2500;
3: SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_bitmap' GROUP BY relfilenode HAVING count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_heap_bitmap;
CREATE TABLE reindex_alter_heap_bitmap (a INT, j INT);
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_heap_bitmap on reindex_alter_heap_bitmap USING bitmap(j);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_btree WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX index idx_reindex_alter_heap_btree;
2&: alter table reindex_alter_heap_btree drop column j;
1: COMMIT;
2<:
2: COMMIT;
3: SELECT COUNT(*) FROM pg_class where relname = 'reindex_alter_heap_btree';
3: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_heap_btree;
CREATE TABLE reindex_alter_heap_btree (a INT, j INT);
insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_heap_btree SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_heap_btree on reindex_alter_heap_btree(j);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_ao_gist WHERE id < 128;
1: BEGIN;
1: REINDEX index idx_gist_reindex_ao;
2&: alter table reindex_ao_gist drop column target;
1: COMMIT;
2<:
2: COMMIT;
3: insert into reindex_ao_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57 , 650), (68, 660) )');
3: SELECT COUNT(*) FROM reindex_ao_gist WHERE id = 1500;
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);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_ao_gist;
CREATE TABLE reindex_ao_gist (
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
);
insert into reindex_ao_gist (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_ao_gist (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 ;
create index idx_gist_reindex_ao on reindex_ao_gist USING Gist(target);
-- 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_ao' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_aoco_gist WHERE id < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX index idx_gist_reindex_aoco;
2&: alter table reindex_aoco_gist drop column target;
1: COMMIT;
2<:
2: COMMIT;
3: insert into reindex_aoco_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57, 650), (68, 660) )') ;
3: SELECT COUNT(*) FROM reindex_aoco_gist WHERE id = 1500;
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);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_aoco_gist;
CREATE TABLE reindex_aoco_gist (
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
);
insert into reindex_aoco_gist (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_aoco_gist (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 ;
create index idx_gist_reindex_aoco on reindex_aoco_gist USING Gist(target);
-- 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);
-- @Description Ensures that alter table during reindex operations on GiST index is ok
--
DELETE FROM reindex_heap_gist WHERE id < 128;
1: BEGIN;
1: REINDEX index idx_gist_reindex_heap;
2&: alter table reindex_heap_gist drop column target;
1: COMMIT;
2<:
2: COMMIT;
3: insert into reindex_heap_gist (id, owner, description, property, poli) values(1500, 'user1500' , 'Testing GiST Index', '((3, 1300), (33, 1330))','( (22,660), (57,650), (68, 660) )');
3: SELECT COUNT(*) FROM reindex_heap_gist WHERE id = 1500;
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);
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_heap_gist;
CREATE TABLE reindex_heap_gist (
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
) ;
insert into reindex_heap_gist (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_heap_gist (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 ;
create index idx_gist_reindex_heap on reindex_heap_gist USING Gist(target);
-- 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);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_ao_bitmap;
2&: ALTER TABLE reindex_alter_ao_bitmap alter column j type numeric;
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_ao_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_ao_bitmap WHERE a = 2500;
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_ao_bitmap;
CREATE TABLE reindex_alter_ao_bitmap (a INT,j INT) WITH (appendonly=true);
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_ao_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create INDEX idx_reindex_alter_ao_bitmap ON reindex_alter_ao_bitmap USING bitmap(a);
SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_bitmap' GROUP BY relfilenode HAVING count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_ao_btree WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX index idx_reindex_alter_ao_btree;
2&: alter table reindex_alter_ao_btree alter column j type numeric;
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_ao_btree VALUES(2500);
3: SELECT count(*) FROM reindex_alter_ao_btree WHERE a = 2500;
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_ao_btree;
CREATE TABLE reindex_alter_ao_btree (a INT,j INT) WITH (appendonly=true);
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_ao_btree SELECT i, i+10 from generate_series(1,1000)i;
CREATE INDEX idx_reindex_alter_ao_btree on reindex_alter_ao_btree(a);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_ao_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_aoco_bitmap;
2&: ALTER TABLE reindex_alter_aoco_bitmap alter column j type numeric;
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_aoco_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_aoco_bitmap WHERE a = 2500;
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_aoco_bitmap;
CREATE TABLE reindex_alter_aoco_bitmap (a INT, j INT) WITH (appendonly=true, orientation=column);
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_aoco_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_aoco_bitmap on reindex_alter_aoco_bitmap USING bitmap(a);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_aoco_btree WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_aoco_btree;
2&: ALTER TABLE reindex_alter_aoco_btree alter column j type numeric;
1: SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_aoco_btree VALUES(2500);
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
3: set enable_seqscan=false;
3: set enable_indexscan=true;
3: SELECT count(*) FROM reindex_alter_aoco_btree WHERE a = 2500;
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_aoco_btree;
CREATE TABLE reindex_alter_aoco_btree (a INT, j INT) WITH (appendonly=true, orientation=column);
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_aoco_btree SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_aoco_btree on reindex_alter_aoco_btree(a);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_aoco_btree' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
-- @Description Ensures that alter table during reindex operations is ok
--
DELETE FROM reindex_alter_heap_bitmap WHERE a < 128;
1: BEGIN;
2: BEGIN;
1: REINDEX INDEX idx_reindex_alter_heap_bitmap;
2&: ALTER TABLE reindex_alter_heap_bitmap ALTER COLUMN j TYPE numeric;
1: SELECT 1 AS relfilenode_same_on_all_segs FROM gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_bitmap' GROUP BY relfilenode HAVING count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
1: COMMIT;
2<:
2: COMMIT;
3: INSERT INTO reindex_alter_heap_bitmap VALUES(2500);
3: SELECT count(*) FROM reindex_alter_heap_bitmap where a = 2500;
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS reindex_alter_heap_bitmap;
CREATE TABLE reindex_alter_heap_bitmap (a INT, j INT);
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
insert INTO reindex_alter_heap_bitmap SELECT i, i+10 from generate_series(1,1000)i;
create index idx_reindex_alter_heap_bitmap on reindex_alter_heap_bitmap USING bitmap(a);
SELECT 1 AS relfilenode_same_on_all_segs from gp_dist_random('pg_class') WHERE relname = 'idx_reindex_alter_heap_bitmap' GROUP BY relfilenode having count(*) = (SELECT count(*) FROM gp_segment_configuration WHERE role='p' AND content > -1);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册