Re: reducing bloat in pg_statistic - Mailing list pgsql-hackers

From Tom Lane
Subject Re: reducing bloat in pg_statistic
Date
Msg-id 646.1134775423@sss.pgh.pa.us
Whole thread Raw
In response to reducing bloat in pg_statistic  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Robert Treat <xzilla@users.sourceforge.net> writes:
> I'm looking at a postgresql 7.3 database that has gotten rather bloated
> in pg_statistic:
> I am trying to figure out a way to shrink this down to something more
> reasonable, with the caveat of not restarting the database server.

You haven't got too many options in 7.3, but it might work reasonably
well to dodelete from pg_statistic;vacuum full pg_statistic;re-analyze to repopulate
vacuum full with no records should take well under a minute.  It won't
shrink the index, but it'll fix the table bloat which seems the worst
part.

The main gotcha here is that any queries started before you can finish
the re-analyze will not have the benefit of statistics; in the worst
case they might choose bad enough plans that you'll wish you had not
done it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: second "begin transaction" emits a warning
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Which qsort is used