Re: speed of querry?

Поиск
Список
Период
Сортировка
От Dawid Kuroczko
Тема Re: speed of querry?
Дата
Msg-id 758d5e7f05041409044eadfcd1@mail.gmail.com
обсуждение исходный текст
Ответ на Re: speed of querry?  ("Joel Fradkin" <jfradkin@wazagua.com>)
Ответы Re: speed of querry?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On 4/14/05, Joel Fradkin <jfradkin@wazagua.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

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Matthew Nuzum"
Дата:
Сообщение: Re: How to improve db performance with $7K?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Foreign key slows down copy/insert