Re: BUG #15717: Index not used when ordering by left joined table column
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #15717: Index not used when ordering by left joined table column |
| Дата | |
| Msg-id | 11046.1553735962@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #15717: Index not used when ordering by left joined table column (PG Bug reporting form <noreply@postgresql.org>) |
| Ответы |
Re: BUG #15717: Index not used when ordering by left joined tablecolumn
|
| Список | pgsql-bugs |
PG Bug reporting form <noreply@postgresql.org> writes:
> The following query runs slow, as it seq scans tables, without using any
> index:
> select
> wp.id as id
> from
> web_page wp
> left join web_url_path url on wp.id=url.page
> order by
> url.priority asc
> limit 1
> I was expecting the "priority" column index would be used to retrieve first
> url then do a reverse join to get the corresponding page, and continue if no
> page is found.
It would probably do that if you used a plain join, or a right join.
But a nestloop plan cannot be driven from the inside of an outer join,
and that's the case this query presents.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера