Try running full vacuum and analyze before

pull/7348/head
naisila 2023-11-16 11:25:05 +03:00
parent b38717d9bf
commit 6cbd8da351
No known key found for this signature in database
GPG Key ID: A824BA9862D73E6D
2 changed files with 12 additions and 7 deletions

View File

@ -73,13 +73,15 @@ 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) -- vacuum (process_toast true) should be vacuuming toast tables (default is true)
CREATE TABLE local_vacuum_table(name text); CREATE TABLE local_vacuum_table(name text);
VACUUM (FULL) local_vacuum_table;
VACUUM ANALYZE local_vacuum_table;
ALTER TABLE local_vacuum_table SET (autovacuum_enabled = false); ALTER TABLE local_vacuum_table SET (autovacuum_enabled = false);
INSERT INTO local_vacuum_table VALUES ('peter'); INSERT INTO local_vacuum_table VALUES ('peter');
select reltoastrelid from pg_class where relname='local_vacuum_table' SELECT reltoastrelid FROM pg_class WHERE relname='local_vacuum_table'
\gset \gset
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass SELECT relfrozenxid::text::integer AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset \gset
VACUUM (FREEZE, PROCESS_TOAST true) local_vacuum_table; VACUUM (FREEZE) local_vacuum_table;
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass; WHERE oid=:reltoastrelid::regclass;
frozen_performed frozen_performed

View File

@ -24,14 +24,17 @@ VACUUM (FULL, FREEZE false, VERBOSE false, ANALYZE false, SKIP_LOCKED false, IND
-- vacuum (process_toast true) should be vacuuming toast tables (default is true) -- vacuum (process_toast true) should be vacuuming toast tables (default is true)
CREATE TABLE local_vacuum_table(name text); CREATE TABLE local_vacuum_table(name text);
VACUUM (FULL) local_vacuum_table;
VACUUM ANALYZE local_vacuum_table;
ALTER TABLE local_vacuum_table SET (autovacuum_enabled = false); ALTER TABLE local_vacuum_table SET (autovacuum_enabled = false);
INSERT INTO local_vacuum_table VALUES ('peter'); INSERT INTO local_vacuum_table VALUES ('peter');
select reltoastrelid from pg_class where relname='local_vacuum_table'
SELECT reltoastrelid FROM pg_class WHERE relname='local_vacuum_table'
\gset
SELECT relfrozenxid::text::integer AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass
\gset \gset
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid=:reltoastrelid::regclass VACUUM (FREEZE) local_vacuum_table;
\gset
VACUUM (FREEZE, PROCESS_TOAST true) local_vacuum_table;
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid=:reltoastrelid::regclass; WHERE oid=:reltoastrelid::regclass;