Re: [SQL] index usage ... strange !?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] index usage ... strange !?
Дата
Msg-id 22018.948148017@sss.pgh.pa.us
обсуждение исходный текст
Ответ на index usage ... strange !?  (Marten Feldtmann <marten@feki.toppoint.de>)
Ответы Re: [SQL] index usage ... strange !?  (Marten Feldtmann <marten@feki.toppoint.de>)
Список pgsql-sql
Marten Feldtmann <marten@feki.toppoint.de> writes:
>  SELECT AO,AT,AV FROM P3AT
>  WHERE EXISTS( SELECT AO FROM P3AT WHERE AV='12' AND AT=12 AND CI=17)

Um ... I dunno what you are trying to accomplish, but this query
almost certainly doesn't do what you want.  Since the inner query
is independent of the outer, you will get back either all the rows
of P3AT (if the inner query yields rows) or none (if it doesn't).

The plan you quote is perfectly reasonable for this query...
the machine is even bright enough to figure out that it only
needs to evaluate the subquery once.
        regards, tom lane


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

Предыдущее
От: Marten Feldtmann
Дата:
Сообщение: index usage ... strange !?
Следующее
От: Michael McCarthy
Дата:
Сообщение: ordering operator for bytea