Re: Q: Performance of join vs embedded query for simple queries?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Q: Performance of join vs embedded query for simple queries?
Дата
Msg-id 2305.1155868636@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Q: Performance of join vs embedded query for simple queries?  (mark@mark.mielke.cc)
Список pgsql-performance
mark@mark.mielke.cc writes:
> That makes sense. Would it be reasonable for the planner to eliminate
> plan considerations based on the existence of unique indexes, or is
> this a fundamentally difficult thing to get right in the general case?

The big obstacle to that at the moment is that we don't have any plan
cache invalidation mechanism; so a plan that depended for correctness on
the existence of a unique index might silently give wrong results after
someone drops the index and inserts non-unique values into the table.
(If the plan actually *uses* the index, then you'd at least get an
access failure ... but if the index was merely used to make an
assumption at plan time, you wouldn't.)

The present "constraint_exclusion" mechanism will actually fail in
exactly this kind of scenario, which is why I insisted it be off by
default :-(

This has been on the radar screen for awhile.  I'd hoped we'd get a
plan invalidation mechanism in place for 8.2, but seems that's not
happening.  Eventually it'll be there, though, and then we can get
more aggressive about making deductions based on constraints.

            regards, tom lane

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

Предыдущее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Q: Performance of join vs embedded query for simple queries?
Следующее
От: alvis
Дата:
Сообщение: Re: Dell PowerEdge 2950 performance