Re: Findout long unused tables in database

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Findout long unused tables in database
Date: 2022-09-27 15:59:35
Message-ID: c71834dd9bad099909be176c0ad0bec70ca01e60.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2022-09-27 at 08:35 +0200, Andreas Kretschmer wrote:
>
>
> Am 26.09.22 um 14:05 schrieb Andreas Fröde:
> > Hello,
> > I am looking for a way to find out when a table was last used for
> > reading. (Without writing every statement in the logfile or putting a
> > trigger on it). Is there such a thing?
> >
>
> no really what you are looking for, i know, but we have
> pg_stat_user_tables. There can you find how often the table was queried
> in the past. Take the data, wait some time, take it again and compare.

Ah, that is the best solution. I should have thought of that.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Federico 2022-09-27 21:11:35 Re: Order by in a sub query when aggregating the main query
Previous Message Stephen Frost 2022-09-27 15:39:36 Re: pgbackrest Help Required