Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> About BETWEEN and the Optimizer
Oracle 8.1.7
I am reading the documentation on optimization. Chapter 4, the Optimizer. It gives an example (6):
===
The following query uses the BETWEEN operator to select all employees
with employee ID numbers between 7500 and 7800:
SELECT *
FROM emp
WHERE empno BETWEEN 7500 AND 7800;
To determine the selectivity of this query, the optimizer decomposes the WHERE clause condition into these two conditions:
empno >= 7500
empno <= 7800
===
This question is more out of curiosity than anything else.
Does using BETWEEN have any advantages over two separate caluses that check < and >? BETWEEN is possibly better for readability, but I am not asking about that. Does BETWEEN somehow let the optimizer tie the two WHERE clauses together where it otherwise would not?
Brian Received on Wed Dec 12 2001 - 12:35:34 CST
![]() |
![]() |