Re: Is it possible to keep track of SELECTs? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Is it possible to keep track of SELECTs?
Date
Msg-id 9799ff799697aa400573647d5f0c6f39722819fb.camel@cybertec.at
Whole thread Raw
In response to Re: Is it possible to keep track of SELECTs?  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Is it possible to keep track of SELECTs?
Next
From: Avi Weinberg
Date:
Subject: RE: [External] Simple way to simulate a bug in logical replication