Skip site navigation (1) Skip section navigation (2)

Re: Drop statistics?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Kerr <dmk(at)mr-paradox(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Drop statistics?
Date: 2012-06-22 17:27:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
David Kerr <dmk(at)mr-paradox(dot)net> writes:
> I'm trying to work through a root cause on a performance problem. I'd like to
> be able to "show" that a problem was fixed by analyzing the table.

> what i've done is
> set default_statistics_target=1
> analyze <Table>

> That gets rid of most of the rows in pg_stats, but i'm still getting decent performance.

I usually do something like

DELETE FROM pg_statistic WHERE starelid = 'foo'::regclass;

(you need to be superuser to be allowed to do this).

You may need to keep an eye on whether auto-analyze is coming along and
undoing what you did, too.

			regards, tom lane

In response to


pgsql-performance by date

Next:From: David KerrDate: 2012-06-22 18:04:36
Subject: Re: Drop statistics?
Previous:From: David KerrDate: 2012-06-22 17:07:56
Subject: Drop statistics?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group