From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org
To: Silvio Brandani <silvio.brandani@tech.sdb.it>
Subject: Re: problem on table statistics
Date: Mon, 09 Jan 2012 09:48:00 -0600
Message-ID: <4F0AB7D002000025000445C2@gw.wicourts.gov> (raw)
In-Reply-To: <4F0AFC85.5050908@tech.sdb.it>
References: <4F0AFC85.5050908@tech.sdb.it>
Silvio Brandani <silvio.brandani@tech.sdb.it> wrote:
> So there is something wrong with table statistics.
It picks the plan which it calculates to have the lowest cost. If
the lowest cost doesn't correspond to the fastest plan, the most
common cause is that your costing factors need adjustment.
> How can I reset the pg_statistics for this table???
It can also be that statistics are stale or are not fine-grained
enough. You can get fresh statistics with the ANALYZE or VACUUM
ANALYZE statements. You can change the granularity of statistics
globally or for particular columns, but that just changes the
behavior of subsequent ANALYZE runs; it doesn't force an immediate
run.
Your post was a little light on the sort of details which allow
people to be most helpful. If problems persist, please read this
before posting again:
http://wiki.postgresql.org/wiki/SlowQueryQuestions
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, silvio.brandani@tech.sdb.it
Subject: Re: problem on table statistics
In-Reply-To: <4F0AB7D002000025000445C2@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox