Re: partial unique index and the planner

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: partial unique index and the planner
Дата
Msg-id 23419.1234723265@sss.pgh.pa.us
обсуждение исходный текст
Ответ на partial unique index and the planner  (Michal Politowski <mpol+pg@meep.pl>)
Ответы Re: partial unique index and the planner  (Michal Politowski <mpol+pg@meep.pl>)
Список pgsql-general
Michal Politowski <mpol+pg@meep.pl> writes:
> Is it normal that plans using a scan on a partial unique index
> estimate that much more than one row is returned?

There isn't currently any special logic to recognize that case;
the estimate is just whatever is going to come out of the normal
statistics-based estimation.

I'm unsure how hard it'd be to improve the situation.  If we've already
identified relevant partial indexes before any of the stats code has to
run then it'd be pretty easy, but that might be a bit fragile.

Anyway, the usual advice for such cases is to see if raising the
statistics target helps.

            regards, tom lane

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: partial unique index and the planner
Следующее
От: Stuart McGraw
Дата:
Сообщение: Running untrusted sql safely?