[HACKERS] [PATCH] Push limit to sort through a subquery

Поиск
Список
Период
Сортировка
От Douglas Doole
Тема [HACKERS] [PATCH] Push limit to sort through a subquery
Дата
Msg-id CADE5jYLuugnEEUsyW6Q_4mZFYTxHxaVCQmGAsF0yiY8ZDggi-w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] [PATCH] Push limit to sort through a subquery
Список pgsql-hackers
We've hit a case where pass_down_bound() isn't pushing the row count limit from limit into sort. The issue is that we're getting a subquery scan node between the limit and the sort. The subquery is only doing column projection and has no quals or SRFs so it should be safe to push the limit into the sort.

The query that hit the problem can be simplified to:

   SELECT * FROM (SELECT A,B FROM T ORDER BY C) LIMIT 5

(Yeah, the query's a little screwy in that the ORDER BY should really be outside the subselect, but it came from a query generator, so that's a different conversation.)

Proposed patch is attached.

- Doug
Salesforce
Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Continuous buildfarm failures on hamster with bin-check
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: [HACKERS] Failed recovery with new faster 2PC code