Re: should I increase default_statistics_target

Поиск
Список
Период
Сортировка
От Ondrej Ivanič
Тема Re: should I increase default_statistics_target
Дата
Msg-id CAM6mie+oj2BrJVOAjzV8gPRNDUaREdKi9sd9U0ozzjtbnaqu1g@mail.gmail.com
обсуждение исходный текст
Ответ на should I increase default_statistics_target  (AI Rumman <rummandba@gmail.com>)
Список pgsql-general
Hi,

On 20 September 2012 20:49, AI Rumman <rummandba@gmail.com> wrote:
> Using explain analyze of a large query I found that in every step there are
> a lot difference between the number of rows  between actual and estimated.
> I am using default_statistics_target 200. Should I increase it?

I would keep it at default level but I would increase it per column:
ALTER TABLE <table> ALTER <column> SET STATISTICS <number>

and you can do the same for index:

ALTER TABLE <index_name> ALTER COLUMN <column> SET STATISTICS <number>

(for function indexes you need to use \d in order to see "real" column name)

Finally, you need to run analyse on that table / column

--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)


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

Предыдущее
От: AI Rumman
Дата:
Сообщение: should I increase default_statistics_target
Следующее
От: pavithra
Дата:
Сообщение: Need psql send email