Re: LIMIT 1 == EXISTS optimization?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LIMIT 1 == EXISTS optimization?
Дата
Msg-id 9560.1254508698@sss.pgh.pa.us
обсуждение исходный текст
Ответ на LIMIT 1 == EXISTS optimization?  (Richard Rowell <richard.rowell@gmail.com>)
Список pgsql-hackers
Richard Rowell <richard.rowell@gmail.com> writes:
> I'm no backend guru, so I was hoping someone could explain what the original
> query-plan was doing.  If all you need to know is if a row exists, why loop
> over all 3M rows?  It seems very simplistic to assume the a LIMIT 1 clause
> on the end of all EXISTS subqueries would be a general case optimization...

[ squint... ]  It should be assuming that already.

It looks like your case might have something to do with using or not
using a partial index.  Can you extract a reproducible test case?
And what PG version is this exactly?
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: remove useless set of active snap
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: latest hstore patch