Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: WHERE NOT ...
When you said A= "" or B>"", oracle is not using index. Try to force it to
use certain index by include hints inside your select statment
Winnie
Pablo Colmenero wrote in message <359C9462.AB623A23_at_intec.es>...
>Maybe this quesion will seem trivial for some database experts, but I
>cannot find an easy and clean solution, so I ask it.
>
>Suppose you have a table T with 3 fields A, B and C and you've got an
>index to all these fields.
>I have noticed that when you make some query like
>
>SELECT A,B,C
>FROM T
>WHERE A ="" AND
> B >"first"
>ORDER BY B,C
>
>It runs quickly, because of the index. But if in the WHERE line you
>write A<>"" instead of A="", the negated condition makes the query very
>slow.
>Right now, I run this query over an Access 97 database, but in the
>future it will run in Oracle 7.
>
>The question is: is there an easy way to write this query (maybe
>changing the index, or something like that) in order to make it fast,
>even in Access?
>If not, is there a solution in Oracle 7?
>
>Thank you.
>
Received on Mon Jul 06 1998 - 22:52:09 CDT
![]() |
![]() |