Re: Why does it sort rows after a nested loop that uses already-sorted indexes?
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Why does it sort rows after a nested loop that uses already-sorted indexes? |
| Дата | |
| Msg-id | 1825378.1713452017@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Why does it sort rows after a nested loop that uses already-sorted indexes? (negora <public@negora.com>) |
| Ответы |
Re: Why does it sort rows after a nested loop that uses already-sorted indexes?
|
| Список | pgsql-general |
negora <public@negora.com> writes:
> As you can see, the planner does detect that the outer loop returns the
> rows presorted by [sales_order.id]. However, it's unable to detect that
> the rows returned by the inner loop are also sorted by [sales_order.id]
> first, and then by [order_line.id].
That's a level of analysis that it doesn't do, and TBH I'm not even
entirely sure it's correct to assume that the output is sorted like
that. At minimum you'd need an additional assumption that the
outer side's join key is unique, which is a factor that we don't
currently track when reasoning about ordering.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера