Is it possible to keep track of SELECTs?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Is it possible to keep track of SELECTs?
Дата
Msg-id CAFCRh--Ar40hz6rA5HdyS2dmTaMeOPPHm9M-AJDHpuYsYz+YvQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is it possible to keep track of SELECTs?
Re: Is it possible to keep track of SELECTs?
Список pgsql-general
Hi,

Our legacy 3-tier backend is adding a feature requested by users,
to keep track of the last-access-time of projects. The primary purpose
is to archive projects which haven't been used (read from) in a while (offline),
or perhaps move them to a cheaper / slower storage tier (still online, but slow access).

In our new 2-tier PostgreSQL-based "backend", project = schema, there's no mid-tier
services we control anymore, only whatever PostgreSQL records about SELECTs.
(I'm assuming other kinds of accesses, like (AUTO or not) VACUUM, are tracked differently).

The docs at [1] mentions:
> The parameter track_counts controls whether cumulative statistics
> are collected about table and index ***accesses***. (emphasis mine)

So is it possible to track the last time a SELECT was performed on some TABLE?
And how would one go about setting that up, if not ON by default?

В списке pgsql-general по дате отправления:

Предыдущее
От: Nick Renders
Дата:
Сообщение: Re: could not open file "global/pg_filenode.map": Operation not permitted
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: Is it possible to keep track of SELECTs?