Re: Weeding out unused user created database objects, could I use pg_catalog?

From: Allan Kamau <kamauallan(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weeding out unused user created database objects, could I use pg_catalog?
Date: 2010-02-12 19:21:35
Message-ID: ab1ea6541002121121u406e556eqffb8e898d4f45780@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 12, 2010 at 9:13 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Richard Huxton <dev(at)archonet(dot)com> writes:
>> On 12/02/10 15:10, Allan Kamau wrote:
>>> Therefore I am looking for a solution that contains
>>> "last-accessed-time" data for these objects, especially for the
>>> functions and maybe the triggers.
>
>> Ah, sorry - misunderstood. There's not any timestamp kept. As you can
>> imagine, it would be a cost you'd have to pay every time you accessed an
>> object.
>
>> The best you can do is to turn on statement logging, parse the logs to
>> see what objects are used and then keep those and their dependencies.
>
> Or: remove some objects, run your test case, see if it succeeds.
> Repeat as needed.
>
>                        regards, tom lane
>

Thanks Richard and Tom for your suggestions, I already have statement
logging (as the application is still in development phase) in CSV
format. I will create a table of the same structure as this log file
and import the data into the DB, then perform the neccessary queries
on this table. Since I am also capturing the duration per statement I
will use the opportunity to streamline some of my queries and stored
procedures.

Allan.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Janet Jacobsen 2010-02-13 02:00:14 "could not read block 0... " error followed by "database does not exist"
Previous Message Marcin Krol 2010-02-12 19:20:19 Re: db size and VACUUM ANALYZE