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 -> Q: query with OR

Q: query with OR

From: alantai <alantai_at_multiactive.com>
Date: 1997/02/11
Message-ID: <33011EA0.4ECC@multiactive.com>#1/1

Senario:
 1.Get the record count for a search returning less than 100000    records.
 2.The table is indexed on fieldone.
 3.Explain Plan shows that the following queries use the index.  

query1: SELECT COUNT(*) FROM tablename

         WHERE fieldone='valueone' and ROWNUM <100000;

query2: SELECT COUNT(*) FROM tablename

         WHERE (fieldone='value1' OR fieldone='value2') 
            AND ROWNUM < 100000;

The first query returns very fast, but the second one takes very long. Is there any way to speed up the second query? Please email to me directly at alantai_at_multiactive.com.

Thanks in advance.

Alan Received on Tue Feb 11 1997 - 00:00:00 CST

Original text of this message

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