From: | tv(at)fuzzy(dot)cz |
---|---|
To: | "Colin 't Hart" <colinthart(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Monitoring object usage? |
Date: | 2010-09-15 12:37:39 |
Message-ID: | 293b8572768b1910ae297d70497adb0f.squirrel@sq.gransy.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Bremer, Gerd | 2010-09-15 12:42:50 | Upload latest JDBC driver releases to Maven Central |
Previous Message | Jayadevan M | 2010-09-15 12:28:35 | Re: Monitoring object usage? |