| От | Tom Lane |
|---|---|
| Тема | Re: Pushing limit into subqueries of a union |
| Дата | |
| Msg-id | 11228.1118365833@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Pushing limit into subqueries of a union (Phil Endecott <spam_from_postgresql_general@chezphil.org>) |
| Список | pgsql-general |
Phil Endecott <spam_from_postgresql_general@chezphil.org> writes:
> I presume that PostgreSQL doesn't try to push the limit clause into the
> subqueries of a UNION ALL in this way. I believe it is safe, isn't it?
Hmm. You don't actually want to push the LIMIT as such into the subplan
--- that would create an extra level of plan node that would simply
waste time at runtime. What you want is for the subquery to be planned
on the assumption that only a small number of tuples will be fetched,
so that "fast start" plans are preferred.
We have all the mechanism for this, but prepunion.c isn't exploiting it.
I'll see what I can do.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера