Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Query faster with multiple WHERE clauses??
I think this is probably a pretty basic DB/SQL question, but I could seem to find the answer in any searches.
Let's say for example I have a table of 200,000 employees in table 'emp' and I want to query for employee #867. I could do this:
SELECT * FROM emp WHERE emp_id = 867
..... but, assuming 'division' and 'department' are also indexed, would the following be faster?.....
SELECT * FROM emp WHERE division = 'distribution' AND department = 'delivery' AND emp_id = 867
I'm going under the assumption that since there are their are fewer numbers of departments and fewest number of divisions, if they were indexed columns, that it would help Oracle more quickly 'narrow' down its search. Or maybe I'm just dreaming?
Thanks!!!! Received on Thu Jan 18 2001 - 01:08:19 CST