| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Conjunction junction
"Alan" <alan_at_erols.com> wrote in message
news:2unbuhF2cbaliU1_at_uni-berlin.de...
> UNION. Of course this can be done procedureally, but the XOR I described
> would have allowed it in straight SQL. Maybe call it an IOR (Immediate OR)
> if XOR is confusing.
There are 2 separate concepts:
1. what connectors between the boolean expressions are allowed, and
2. row limit "predicate".
Admittedly item #2 would be different in different SQL dialects. For example
SELECT stock_location
FROM pennants
WHERE (color = 'red' OR color = 'green')
and rownum <=1 ^^^^^^^^^^^^
Alternatively, it might be the client that controls how many rows are fetched.
Performance of the above query is completely different topic. For example, optimizer might decide to convert this query into a concatenation. It executes the first branch, and the row satisfies the condition color = 'red', then it goes to the output, and execution stops immediately. Otherwise, it would follow to the second branch. Alternative execution plan is what you suggested: it iterates the relation tuples and checks the [complex] condition color = 'red' OR color = 'green' and stops as soon as a tuple is found. Received on Mon Nov 01 2004 - 12:41:20 CST
![]() |
![]() |