Re: Identifying old/unused views and table

From: Jason Long <mailing(dot)lists(at)octgsoftware(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, pgsql-general(at)postgresql(dot)org
Subject: Re: Identifying old/unused views and table
Date: 2011-09-29 22:12:52
Message-ID: 1317334374.2348.3.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2011-09-28 at 08:52 +0200, Guillaume Lelarge wrote:
> On Wed, 2011-09-28 at 09:04 +0800, Craig Ringer wrote:
> > On 09/28/2011 04:51 AM, Jason Long wrote:
> > > I have an application with a couple hundred views and a couple hundred
> > > tables.
> > >
> > > Is there some way I can find out which views have been accessed in the
> > > last 6 months or so? Or some way to log this?
> > >
> > > I know there are views and tables that are no longer in used by my
> > > application and I am looking for a way to identify them.
> >
> > Look at the pg_catalog.pg_stat* tables
> >
>
> I fail to see how that gives him any answer on the views, and tables no
> longer used. AFAICT, there's no way to know for views (apart from
> logging all queries in the log). As for tables, still apart from the
> log, pg_stat_user_tables could give an answer if he was monitoring it at
> least the last six months.
>
>

Thanks for the replies. Views were my main problem. My application
could use some cleanup. Doing is manually is probably the best
approach. I was just looking for a jump start.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Long 2011-09-29 22:57:18 Any was to prevent a join if no columns are selected from a view?
Previous Message Greg Smith 2011-09-29 21:04:51 Re: : Looking for a PostgreSQL book