On Thu, 17 Jun 2021 at 15:17, kaido vaikla <kaido.vaikla@gmail.com> wrote:
>
> Hi,
>
> But my question was did you check, if t1 and/or t2 relfile was deleted before complete vacuum?
> Why I had, in my example, temporarily 335 files extra (old relfiles?). And removed after vacuum completely finished.
for me it is mostly the partitions and its indexes and some metadata
relates to those tables.
how i check that.
create table before__vacuum as select oid, relname,
relfilenode,reltablespace from pg_class order by oid;
vacuum full t;
create table after__vacuum as select oid, relname,
relfilenode,reltablespace from pg_class order by oid;
and then check relfilenode that do not exist in the db after full vacuum,
select b.* from before__vacuum b where not exists ( select 1 from
after__vacuum a where b.relfilenode = a.relfilenode) order by oid;
oid | relname | relfilenode | reltablespace
-------+---------+-------------+---------------
26497 | t0 | 26497 | 0
26500 | t0_pkey | 26500 | 0
26502 | t1 | 26502 | 0
26505 | t1_pkey | 26505 | 0
26507 | t2 | 26507 | 0
26510 | t2_pkey | 26510 | 0
(6 rows)
I am not sure what I am doing wrong, but you can run that yourself,
and help figure out what is there in those 300+ changes.