Re: Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.
Дата
Msg-id 1388264608.60549.YahooMailNeo@web122306.mail.ne1.yahoo.com
обсуждение исходный текст
Ответ на Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.  (Michael Kolomeitsev <mkolomeitsev@gmail.com>)
Ответы Re: Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Michael Kolomeitsev <mkolomeitsev@gmail.com> wrote:

> it is clear for me why t1_b_a_idx is better. The question is: Is
> postgresql able to see that?

For a number of reasons I never consider a bulk load complete until
I run VACUUM FREEZE ANALYZE on the table(s) involved.  When I try
your test case without that, I get the bad index choice.  When I
then run VACUUM FREEZE ANALYZE on the database I get the good index
choice.

There may be some lesser maintenance which sets up visibility
information and provides the planner with enough data to make a
good choice, I just noticed that you were not following what I
consider to be rote good practice, tried it, and it solved the
problem.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Are there some additional postgres tuning to improve performance in multi tenant system
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Pg makes nonoptimal choice between two multicolumn indexes with the same columns but in different order.