Re: [HACKERS] union and LIMIT problem

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <wieck(at)debis(dot)com>, oleg(at)sai(dot)msu(dot)su, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] union and LIMIT problem
Date: 1999-10-07 17:39:40
Message-ID: 199910071739.NAA02643@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Should apply to overall result, like ORDER BY.

>
> 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
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-10-07 17:45:10 Re: [HACKERS] Re: psql and comments
Previous Message Tom Lane 1999-10-07 17:35:36 Re: [HACKERS] psql and comments