Re: Monitoring object usage? - Mailing list pgsql-general

From tv@fuzzy.cz
Subject Re: Monitoring object usage?
Date
Msg-id 293b8572768b1910ae297d70497adb0f.squirrel@sq.gransy.com
Whole thread Raw
In response to Monitoring object usage?  ("Colin 't Hart" <colinthart@gmail.com>)
List pgsql-general
Well, you can see usage statistics for tables, indexes, functions and
sequences ... but AFAIK it's not possible to do that for columns.

See this
http://www.postgresql.org/docs/8.4/static/runtime-config-statistics.html
and then use pg_stat_ and pg_statio_ catalogs
(http://www.postgresql.org/docs/8.4/static/monitoring-stats.html) to find
objects that were not accessed recently (numbers are 0 or do not change
anymore, etc.).

But be careful as this may backfire quite easily - imagine an index that's
used only in a batch processing the end of month. You could easily decide
it's not necessary and drop it, causing a disaster.

Tomas

> Hi,
>
> I'm trying to get a grip on a new body of code and a Postgres database
> that
> I'm working with. In particular I've been tasked with cleaning up the
> database.
>
> Is there a way in Postgres to enable monitoring on tables and columns to
> determine what's not actively being used?
>
> This would then form input for a more thorough check into the code base to
> see what's really not being used.
>
>
> Thanks & cheers,
>
> Colin
>



pgsql-general by date:

Previous
From: Jayadevan M
Date:
Subject: Re: Monitoring object usage?
Next
From: Peter Hopfgartner
Date:
Subject: Getting FATAL: terminating connection due to administrator command