Re: [HACKERS] union and LIMIT problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] union and LIMIT problem
Дата
Msg-id 29687.939317382@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] union and LIMIT problem  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] union and LIMIT problem
Список pgsql-hackers
>>>> * UNION with LIMIT fails
>> 
>> and must fail by it's implementation. LIMIT is handled by the
>> outermost executor loop, suppressing OFFSET result tuples and
>> stopping execution after LIMIT results sent to the client.

> Ah, but it works sometimes:

Well, the real question is what do you mean by "works" or "fails".
In particular, do you think that LIMIT applies to the overall result
of the whole query, or to any one sub-select?

IIRC, ORDER BY is supposed to apply to the end result (and you can
only write it at the very end of the query, not after a sub-select),
and I'd vote for making LIMIT work the same.  In which case the
executor should be fine, and we probably just have a problem with
the parser hanging the info on the wrong node of the querytree...
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: psql and comments
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] psql and comments