Try moving the test to multi_utilities

pull/7348/head
naisila 2023-11-17 12:20:52 +03:00
parent 9738fdf997
commit 51923a29b9
No known key found for this signature in database
GPG Key ID: A824BA9862D73E6D
4 changed files with 43 additions and 120 deletions

View File

@ -424,6 +424,31 @@ FROM pg_total_relation_size('local_vacuum_table') s ;
35000000 35000000
(1 row) (1 row)
-- vacuum (process_toast false) should not be vacuuming toast tables (default is true)
select reltoastrelid from pg_class where relname='local_vacuum_table'
\gset
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
insert into local_vacuum_table select i from generate_series(1,10000) i;
VACUUM (FREEZE, PROCESS_TOAST true) local_vacuum_table;
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
frozen_performed
---------------------------------------------------------------------
t
(1 row)
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
VACUUM (FREEZE, PROCESS_TOAST false) local_vacuum_table;
SELECT relfrozenxid::text::integer = :frozenxid AS frozen_not_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
frozen_not_performed
---------------------------------------------------------------------
t
(1 row)
delete from local_vacuum_table;
-- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true) -- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true)
insert into local_vacuum_table select i from generate_series(1,1000000) i; insert into local_vacuum_table select i from generate_series(1,1000000) i;
delete from local_vacuum_table; delete from local_vacuum_table;

View File

@ -71,69 +71,6 @@ NOTICE: issuing VACUUM (FULL,TRUNCATE false,INDEX_CLEANUP auto) pg14.t1_980000
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing VACUUM (FULL,TRUNCATE false,INDEX_CLEANUP auto) pg14.t1_980001 NOTICE: issuing VACUUM (FULL,TRUNCATE false,INDEX_CLEANUP auto) pg14.t1_980001
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
-- vacuum (process_toast true) should be vacuuming toast tables (default is true)
CREATE TABLE pg14_local_vacuum_table(id integer, name text, age integer);
-- add some data to the local table
\copy pg14_local_vacuum_table (id, name) from stdin with csv
VACUUM pg14_local_vacuum_table;
ANALYZE pg14_local_vacuum_table;
VACUUM (FULL) pg14_local_vacuum_table;
VACUUM ANALYZE pg14_local_vacuum_table;
ALTER TABLE pg14_local_vacuum_table SET (autovacuum_enabled = false);
SELECT reltoastrelid FROM pg_class WHERE relname='pg14_local_vacuum_table'
\gset
SELECT relfrozenxid::text::integer AS frozenxid, 'text to ignore' AS fix_flaky FROM pg_class WHERE oid=:reltoastrelid::regclass;
frozenxid | fix_flaky
---------------------------------------------------------------------
(1 row)
\gset
SELECT relfrozenxid::text::integer AS table_frozenxid, 'text to ignore' AS fix_flaky FROM pg_class WHERE relname='pg14_local_vacuum_table';
table_frozenxid | fix_flaky
---------------------------------------------------------------------
(1 row)
\gset
INSERT INTO pg14_local_vacuum_table VALUES (5, 'naisila');
VACUUM (FREEZE) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (6, 'emel');
VACUUM (FREEZE) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (7, 'onur');
VACUUM (FREEZE) pg14_local_vacuum_table;
SELECT relname, :frozenxid AS old_toast, :table_frozenxid AS old_table,
relfrozenxid::text::integer AS frozenxid, 'text to ignore' AS fix_flaky
FROM pg_class WHERE oid=:reltoastrelid::regclass OR relname = 'pg14_local_vacuum_table';
relname | old_toast | old_table | frozenxid | fix_flaky
---------------------------------------------------------------------
(2 rows)
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
frozen_performed
---------------------------------------------------------------------
t
(1 row)
-- vacuum (process_toast false) should not be vacuuming toast tables (default is true)
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
INSERT INTO pg14_local_vacuum_table VALUES (8, 'aykut');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (9, 'ozan');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (10, 'gurkan');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
SELECT relfrozenxid::text::integer = :frozenxid AS frozen_not_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
frozen_not_performed
---------------------------------------------------------------------
t
(1 row)
SET citus.log_remote_commands TO OFF; SET citus.log_remote_commands TO OFF;
create table dist(a int, b int); create table dist(a int, b int);
select create_distributed_table('dist','a'); select create_distributed_table('dist','a');

View File

@ -272,6 +272,24 @@ VACUUM (INDEX_CLEANUP ON, PARALLEL 1) local_vacuum_table;
SELECT CASE WHEN s BETWEEN 20000000 AND 49999999 THEN 35000000 ELSE s END size SELECT CASE WHEN s BETWEEN 20000000 AND 49999999 THEN 35000000 ELSE s END size
FROM pg_total_relation_size('local_vacuum_table') s ; FROM pg_total_relation_size('local_vacuum_table') s ;
-- vacuum (process_toast false) should not be vacuuming toast tables (default is true)
select reltoastrelid from pg_class where relname='local_vacuum_table'
\gset
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
insert into local_vacuum_table select i from generate_series(1,10000) i;
VACUUM (FREEZE, PROCESS_TOAST true) local_vacuum_table;
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
VACUUM (FREEZE, PROCESS_TOAST false) local_vacuum_table;
SELECT relfrozenxid::text::integer = :frozenxid AS frozen_not_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
delete from local_vacuum_table;
-- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true) -- vacuum (truncate false) should not attempt to truncate off any empty pages at the end of the table (default is true)
insert into local_vacuum_table select i from generate_series(1,1000000) i; insert into local_vacuum_table select i from generate_series(1,1000000) i;
delete from local_vacuum_table; delete from local_vacuum_table;

View File

@ -22,63 +22,6 @@ VACUUM (INDEX_CLEANUP "AUTOX") t1;
VACUUM (FULL, FREEZE, VERBOSE false, ANALYZE, SKIP_LOCKED, INDEX_CLEANUP, PROCESS_TOAST, TRUNCATE) t1; VACUUM (FULL, FREEZE, VERBOSE false, ANALYZE, SKIP_LOCKED, INDEX_CLEANUP, PROCESS_TOAST, TRUNCATE) t1;
VACUUM (FULL, FREEZE false, VERBOSE false, ANALYZE false, SKIP_LOCKED false, INDEX_CLEANUP "Auto", PROCESS_TOAST true, TRUNCATE false) t1; VACUUM (FULL, FREEZE false, VERBOSE false, ANALYZE false, SKIP_LOCKED false, INDEX_CLEANUP "Auto", PROCESS_TOAST true, TRUNCATE false) t1;
-- vacuum (process_toast true) should be vacuuming toast tables (default is true)
CREATE TABLE pg14_local_vacuum_table(id integer, name text, age integer);
-- add some data to the local table
\copy pg14_local_vacuum_table (id, name) from stdin with csv
1,bugs
2,babs
3,buster
4,roger
\.
VACUUM pg14_local_vacuum_table;
ANALYZE pg14_local_vacuum_table;
VACUUM (FULL) pg14_local_vacuum_table;
VACUUM ANALYZE pg14_local_vacuum_table;
ALTER TABLE pg14_local_vacuum_table SET (autovacuum_enabled = false);
SELECT reltoastrelid FROM pg_class WHERE relname='pg14_local_vacuum_table'
\gset
SELECT relfrozenxid::text::integer AS frozenxid, 'text to ignore' AS fix_flaky FROM pg_class WHERE oid=:reltoastrelid::regclass;
\gset
SELECT relfrozenxid::text::integer AS table_frozenxid, 'text to ignore' AS fix_flaky FROM pg_class WHERE relname='pg14_local_vacuum_table';
\gset
INSERT INTO pg14_local_vacuum_table VALUES (5, 'naisila');
VACUUM (FREEZE) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (6, 'emel');
VACUUM (FREEZE) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (7, 'onur');
VACUUM (FREEZE) pg14_local_vacuum_table;
SELECT relname, :frozenxid AS old_toast, :table_frozenxid AS old_table,
relfrozenxid::text::integer AS frozenxid, 'text to ignore' AS fix_flaky
FROM pg_class WHERE oid=:reltoastrelid::regclass OR relname = 'pg14_local_vacuum_table';
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
-- vacuum (process_toast false) should not be vacuuming toast tables (default is true)
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset
INSERT INTO pg14_local_vacuum_table VALUES (8, 'aykut');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (9, 'ozan');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
INSERT INTO pg14_local_vacuum_table VALUES (10, 'gurkan');
VACUUM (FREEZE, PROCESS_TOAST false) pg14_local_vacuum_table;
SELECT relfrozenxid::text::integer = :frozenxid AS frozen_not_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass;
SET citus.log_remote_commands TO OFF; SET citus.log_remote_commands TO OFF;
create table dist(a int, b int); create table dist(a int, b int);