Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Maximun number of unions in a single query

Re: Maximun number of unions in a single query

From: <fitzjarrell_at_cox.net>
Date: 8 Jun 2005 09:54:13 -0700
Message-ID: <1118249653.866649.161640@g43g2000cwa.googlegroups.com>

hpuxrac wrote:
> Oh, that is easy. It is directly related to the idiot factor of the
> writer of the SQL.
>
> --
> Billy
>
> Too much caffeine or are you off your medication?
>
> If you don't want to answer a question don't answer it.
>
> Mr. Fitzpatrick at least gave a reasonable answer first before joining
> in your weak response.

Why would someone use a UNION? To 'join' data from tables which cannot otherwise be joined. Asking for the LIMIT on the number of UNIONs one can use certanly indicates the schema was not designed properly, and will produce a performance nightmare in production. Somewhere along the design/implementation line someone with little clue contributed much, else why would it be necessary to string along innumerable UNION operators to generate a result? In a well-thought-out system I can see no reason to do so. That statement does NOT indicate there may not be a valid reason at some point for a one-off query to use UNION, but to implement an endless list of select ... UNION select ... UNION select ... is ridiculous, which is what the original poster is apparently attempting to do. Why would the question of how MANY are allowed in a list have surfaced?

Stringing UNIONs in a never-ending list is foolhardy, and, as I stated before, belies a poor database/schema design. The OP would be better served, in my opinion, to work on redesigning the schema rather than creating queries which will be performance bottlenecks.

David Fitzjarrell Received on Wed Jun 08 2005 - 11:54:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US