Re: strange index behaviour with different statistics target

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strange index behaviour with different statistics target
Дата
Msg-id 3043.1231887961@sss.pgh.pa.us
обсуждение исходный текст
Ответ на strange index behaviour with different statistics target  (Jeff Frost <jeff@frostconsultingllc.com>)
Ответы Re: strange index behaviour with different statistics target  (Jeff Frost <jeff@frostconsultingllc.com>)
Список pgsql-performance
Jeff Frost <jeff@frostconsultingllc.com> writes:
> So, my question is, should changing the stats target on the shape column
> affect the stats for the content_id and content_type columns?

It would change the size of the sample for the table, which might
improve the accuracy of the stats.  IIRC you'd still get the same number
of histogram entries and most-common-values for the other columns, but
they might be more accurate.

> Also, why does the index on content_id win out over the compound index
> on (content_type, content_id)?

It's deciding (apparently correctly, from the explain results) that the
larger index isn't increasing the selectivity enough to be worth its
extra search cost.  I suppose content_type = 'Story' isn't very
selective in this table?

            regards, tom lane

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

Предыдущее
От: Jeff Frost
Дата:
Сообщение: strange index behaviour with different statistics target
Следующее
От: Jeff Frost
Дата:
Сообщение: Re: strange index behaviour with different statistics target