Re: [GENERAL] Partial indices...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Partial indices...
Дата
Msg-id 27300.1065892319@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Partial indices...  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-bugs
Martijn van Oosterhout <kleptog@svana.org> writes:
> That's very strange.

Not really.  In the dummy example, the two indexes are exactly the same
size and so there is no reason for the planner to prefer one over the
other.  (Note that the two plans have exactly the same estimated cost.)

In a real example, with appropriate statistics from VACUUM or ANALYZE,
the planner would tend to prefer the smaller index.

If we had code to suppress the extra evaluation of the partial-index
condition (which we do not) then possibly the planner would be able
to favor the partial index on the grounds of less computation per row.
I don't see any simple way to suppress those clauses early enough to
let that cost difference figure into planning, though.

            regards, tom lane

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

Предыдущее
От: Dmitry Tkach
Дата:
Сообщение: Partial indices...
Следующее
От: Robert Creager
Дата:
Сообщение: create temp table ... inherits