From: John Siracusa <siracusa@mindspring.com>
To: Postgres Performance <pgsql-performance@postgresql.org>
Subject: Re: Use my (date) index, darn it!
Date: Mon, 05 Jan 2004 13:15:56 -0500
Message-ID: <BC1F140C.71330%siracusa@mindspring.com> (raw)
In-Reply-To: <m3ekuefinx.fsf@wolfe.cbbrowne.com>
On 1/5/04 11:45 AM, Christopher Browne wrote:
> It sounds to me as though the statistics that are being collected
> aren't "good enough." That tends to be a sign that the quantity of
> statistics (e.g. - bins in the histogram) are insufficient.
>
> This would be resolved by changing the number of bins (default of 10)
> via "ALTER TABLE FOO ALTER COLUMN BAR SET STATISTICS 100" (or some
> other value higher than 10).
I did that, but I wasn't sure what value to use and what column to increase.
I believe I increased the date column itself to 50 or something, but then I
wasn't sure what to do next. I re-analyzed the table with the date column
set to 50 but it didn't seem to help, so I resorted to clustering.
> Clustering would rearrange the contents of the table, and perhaps make
> the histogram 'more representative.' Increasing the "SET STATISTICS"
> value will quite likely be even more helpful, and is a lot less
> expensive than clustering the table...
What column(s) should I increase? Do I have to do anything after increasing
the statistics, or do I just wait for the stats collector to do its thing?
-John
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-performance@postgresql.org
Cc: siracusa@mindspring.com
Subject: Re: Use my (date) index, darn it!
In-Reply-To: <BC1F140C.71330%siracusa@mindspring.com>
* 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