Re: Weeding out unused user created database objects, could I use pg_catalog? - Mailing list pgsql-general

From Allan Kamau
Subject Re: Weeding out unused user created database objects, could I use pg_catalog?
Date
Msg-id ab1ea6541002121121u406e556eqffb8e898d4f45780@mail.gmail.com
Whole thread Raw
In response to Re: Weeding out unused user created database objects, could I use pg_catalog?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Feb 12, 2010 at 9:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Richard Huxton <dev@archonet.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.

pgsql-general by date:

Previous
From: Marcin Krol
Date:
Subject: Re: db size and VACUUM ANALYZE
Next
From: Janet S Jacobsen
Date:
Subject: "could not read block 0... " error followed by "database does not exist"