From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Dominique Devienne <ddevienne@gmail.com>
To: Christophe Pettus <xof@thebuild.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Is it possible to keep track of SELECTs?
Date: Tue, 12 Mar 2024 16:47:40 +0100
Message-ID: <9799ff799697aa400573647d5f0c6f39722819fb.camel@cybertec.at> (raw)
In-Reply-To: <CAFCRh-8GKecKL9ojzigBnS0qix80vOi0E0LujH5pd2CufVEpCA@mail.gmail.com>
References: <CAFCRh--Ar40hz6rA5HdyS2dmTaMeOPPHm9M-AJDHpuYsYz+YvQ@mail.gmail.com>
<52713980-BE9D-4A45-8052-862DB6123494@thebuild.com>
<CAFCRh-8GKecKL9ojzigBnS0qix80vOi0E0LujH5pd2CufVEpCA@mail.gmail.com>
On Tue, 2024-03-12 at 16:34 +0100, Dominique Devienne wrote:
> PostgreSQL tables and indexes are ultimately files.
> And there are ways to map them to file names, I've seen in the past.
> So isn't it possible, provided the filesystem tracks last access time, to infer when a table was accessed the last time?
Sure, but that won't necessarily tell you when the table was last used.
It could be autovacuum or autoanalyze that last accessed your table.
Also, if the data happen to be in shared buffers, the file won't be read.
Using the PostgreSQL statistics is a much better method.
Yours,
Laurenz Albe
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: laurenz.albe@cybertec.at, ddevienne@gmail.com, xof@thebuild.com
Subject: Re: Is it possible to keep track of SELECTs?
In-Reply-To: <9799ff799697aa400573647d5f0c6f39722819fb.camel@cybertec.at>
References: <CAFCRh--Ar40hz6rA5HdyS2dmTaMeOPPHm9M-AJDHpuYsYz+YvQ@mail.gmail.com> <52713980-BE9D-4A45-8052-862DB6123494@thebuild.com> <CAFCRh-8GKecKL9ojzigBnS0qix80vOi0E0LujH5pd2CufVEpCA@mail.gmail.com> <9799ff799697aa400573647d5f0c6f39722819fb.camel@cybertec.at>
* 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