Re: Why are data files getting modified?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Abhishek Bhola <abhishek(dot)bhola(at)japannext(dot)co(dot)jp>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why are data files getting modified?
Date: 2022-02-09 16:09:31
Message-ID: 421e2826a8048d9601a95c3c415866c0abea878f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2022-02-10 at 00:29 +0900, Abhishek Bhola wrote:
> > > I see there is an AUTOVACUUM job started on all the partitions that have been
> > > read (on which select has run). I am assuming the reason why Postgres is
> > > autovacuuming these large partitions is this:
> > >
> > > db=# SELECT c.relname as table_name, c.relkind as type, age(c.relfrozenxid) as age,
> > > c.relfrozenxid FROM pg_class AS c WHERE age(c.relfrozenxid) <> 2147483647 ORDER BY 3 DESC LIMIT 20;
> > >         table_name         | type |    age    | relfrozenxid
> > > ---------------------------+------+-----------+--------------
> > >  hist_omx_orderaudit201506 | r    | 201463508 |       319891
> > >  hist_omx_orderaudit201509 | r    | 201418497 |       364902
> > >  hist_omx_orderaudit201205 | r    | 201142042 |       641357
> > >
> > > autovacuum_freeze_max_age
> > > ---------------------------
> > >  200000000
> > > (1 row)
>
> I see, but then why is the autovacuum getting triggered after the select command?

Autovacuum is triggered because "relfrozenxid" is nore than 200000000 transactions
in the past.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ludwig Isaac Lim 2022-02-09 16:32:23 Network Card Not Listening at Startup
Previous Message Abhishek Bhola 2022-02-09 15:29:38 Re: Why are data files getting modified?