From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: vacuumlo
Date: Mon, 30 Aug 2021 13:38:14 -0400
Message-ID: <edb97021-ca64-a0e2-0181-f1eb280c9c58@gmail.com> (raw)
In-Reply-To: <9395a02bc37b8c7a3ca09441d288ff49e1c19c39.camel@cybertec.at>
References: <DBAPR08MB5687F490FBCC6065B1F6224BC0FE9@DBAPR08MB5687.eurprd08.prod.outlook.com>
<CAOBaU_YNAsTVHXS1UFw_XBt2YOZjwsJ3KMnZXrwqKb+86WAhpg@mail.gmail.com>
<DBAPR08MB5687AE8E62995E251E23E26BC0CB9@DBAPR08MB5687.eurprd08.prod.outlook.com>
<9395a02bc37b8c7a3ca09441d288ff49e1c19c39.camel@cybertec.at>
That can be verified by checking RELFILENODE of the table. VACUUM FULL
changes RELFILENODE:
|mgogala=# select relfilenode from pg_class where relname='emp';
relfilenode
-------------
52178
(1 row)
mgogala=# vacuum full emp;
VACUUM
mgogala=# select relfilenode from pg_class where relname='emp';
relfilenode
-------------
52182
(1 row)
|
According to unsubstantiated rumors from
https://www.postgresql.org/docs/13/catalog-pg-class.html, the definition
of RELFILENODE column is as follows:
relfilenode oid
Name of the on-disk file of this relation; zero means this is a “mapped”
relation whose disk file name is determined by low-level state
||Change of the RELFILENODE means that the relation has got a new file.
And that means that vacuum full rewrites the table, just as Laurenz has
said. Note that OID itself is NOT changed.
||
On 8/30/21 1:15 PM, Laurenz Albe wrote:
> VACUUM (FULL) will write a compact copy of the table, then delete the old one,
> so it temporarily needs more space. It may be a good idea to put "pg_wal" into
> a different file system, so that WAL space cannot run out even if the data files
> fill the file system. Then PostgreSQL won't crash, and the files will be removed.
--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: gogala.mladen@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: vacuumlo
In-Reply-To: <edb97021-ca64-a0e2-0181-f1eb280c9c58@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox