From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: The age() of a column?
Date: Wed, 28 Nov 2018 21:21:44 -0800
Message-ID: <455f39d1-fe8f-815a-1b42-780cf79e8aa2@aklaver.com> (raw)
In-Reply-To: <5e967a88-1054-5559-0712-44ef00b6b7c1@gmail.com>
References: <5e967a88-1054-5559-0712-44ef00b6b7c1@gmail.com>
On 11/28/18 7:32 PM, Ron wrote:
> What does it mean, and where is it documented? The only place in the
https://www.postgresql.org/docs/10/routine-vacuuming.html
"The age column measures the number of transactions from the cutoff XID
to the current transaction's XID."
> docs I see reference to age() is
> https://www.postgresql.org/docs/9.6/functions-datetime.html and this
> doesn't seem to fit that use case.
>
> Thanks
>
> TAPb=# select COALESCE(ta.schemaname, 'pg_toast') || '.' || cl.relname,
> cl.relfrozenxid,
> age(cl.relfrozenxid)
> from pg_class cl FULL JOIN pg_tables ta
> ON ta.tablename = cl.relname
> where not cl.relfrozenxid = xid '0'
> --and age(cl.relfrozenxid) > 4000000
> order by 1
> limit 30;
> ?column? | relfrozenxid | age
> -------------------------------+--------------+---------
> cds.ach_return_batch | 58569152 | 2111005
> cds.ach_return_detail | 58569152 | 2111005
> cds.all_day_event | 58569152 | 2111005
> cds.all_day_event_trigger | 58569152 | 2111005
> [snip]
> cds.bank_ftp | 58569152 | 2111005
> cds.bank_health_care_job | 58569152 | 2111005
> cds.bank_inbound_file | 58569152 | 2111005
> cds.bank_input_format | 58569152 | 2111005
> (30 rows)
>
>
--
Adrian Klaver
adrian.klaver@aklaver.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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, ronljohnsonjr@gmail.com
Subject: Re: The age() of a column?
In-Reply-To: <455f39d1-fe8f-815a-1b42-780cf79e8aa2@aklaver.com>
References: <5e967a88-1054-5559-0712-44ef00b6b7c1@gmail.com> <455f39d1-fe8f-815a-1b42-780cf79e8aa2@aklaver.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