From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andreas Kretschmer <andreas@a-kretschmer.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Findout long unused tables in database
Date: Tue, 27 Sep 2022 17:59:35 +0200
Message-ID: <c71834dd9bad099909be176c0ad0bec70ca01e60.camel@cybertec.at> (raw)
In-Reply-To: <bf5d2650-53b4-0908-40ed-2d26024bc712@a-kretschmer.de>
References: <3d837584-aca0-a8c1-a78b-442071ec723f@andreas.spider-net.de>
<bf5d2650-53b4-0908-40ed-2d26024bc712@a-kretschmer.de>
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
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, andreas@a-kretschmer.de
Subject: Re: Findout long unused tables in database
In-Reply-To: <c71834dd9bad099909be176c0ad0bec70ca01e60.camel@cybertec.at>
References: <3d837584-aca0-a8c1-a78b-442071ec723f@andreas.spider-net.de> <bf5d2650-53b4-0908-40ed-2d26024bc712@a-kretschmer.de> <c71834dd9bad099909be176c0ad0bec70ca01e60.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