Re: Is it possible to keep track of SELECTs?

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Is it possible to keep track of SELECTs?
Date: 2024-03-12 14:29:51
Message-ID: 52713980-BE9D-4A45-8052-862DB6123494@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Mar 12, 2024, at 07:15, Dominique Devienne <ddevienne(at)gmail(dot)com> wrote:
> So is it possible to track the last time a SELECT was performed on some TABLE?

Directly, no. You could periodically sample the various table-level statistics, and conclude that tables that have had some type of scan since the last scan have had a SELECT run against them. It might not be 100% accurate if (for example) you reset the statistics or lose them for some other reason, but it might be sufficient for the application.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amna Abdul Rehman 2024-03-12 14:43:13 Postgresql docker health check
Previous Message Dominique Devienne 2024-03-12 14:15:35 Is it possible to keep track of SELECTs?