| От | 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 !?
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера