From: | Dawid Kuroczko <qnex42(at)gmail(dot)com> |
---|---|
To: | Joel Fradkin <jfradkin(at)wazagua(dot)com> |
Cc: | PERFORM <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: speed of querry? |
Date: | 2005-04-14 16:04:02 |
Message-ID: | 758d5e7f05041409044eadfcd1@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On 4/14/05, Joel Fradkin <jfradkin(at)wazagua(dot)com> wrote:
> Josh from commandprompt.com had me alter the config to have
> default_statistics_target = 250
>
> Is this somehow related to what your asking me to do?
> I did do an analyze, but have only ran the viw a few times.
well, he did suggest the right thing. However this parameter
applies to newly created tables, so either recreate the tables
or do the ALTER TABLE I've sent eariler.
Basically it tells postgres how many values should it keep for
statistics per column. The config default_statistics_target
is the default (= used when creating table) and ALTER... is
a way to change it later.
The more statistics PostgreSQL has means it can better
predict how much data will be returned -- and this directly
leads to a choice how to handle the data (order in which
tables should be read, whether to use index or not, which
algorithm use for join, etc.). The more statistics, the better
PostgreSQL is able to predict. The more statistics, the slower
planner is able to do the analysis. So you have to find
a value which will be as much as is needed to accurately
predict the results but not more! PostgreSQL's default of
10 is a bit conservative, hence the suggestions to increase
it. :) [ and so is random_page_cost or some people have
found that in their cases it is beneficial to reduce the value,
even as much as below 2. ]
Hope this clairifies things a bit.
Regards,
Dawid
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2005-04-14 16:11:41 | Re: Foreign key slows down copy/insert |
Previous Message | Matthew Nuzum | 2005-04-14 15:55:42 | Re: How to improve db performance with $7K? |