How you will avoid your query from using indexes?

SELECT * FROM emp
Where emp_no+' '=12345;
i.e you have to concatenate the column name with space within codes in the where condition.
SELECT /*+ FULL(a) */ ename, emp_no from emp
where emp_no=1234;
i.e using HINTS

Showing Answers 1 - 8 of 8 Answers

rajaramian

  • Feb 8th, 2006
 

Write a statement without WHERE clause. This will avoid a query from using indexes.

  Was this answer useful?  Yes

vishal

  • May 24th, 2007
 

you can disable the index

ALTER INDEX <index_name> [ON <table_name>] DISABLE

If you are using any column in where clause which has index on it and you dont want to use index for it then perform some operation on that column.

If you perform operation on the objects referenced in where clause then it does not use index.

eg:     select empno,ename
           from emp
          emp where substr(ename,1,5)='Madhu';

The above query will not use any index even if its present on ename.

  Was this answer useful?  Yes

Arijit

  • Jul 12th, 2007
 

use the FULL hint:-
select /*+FULL*/ * from emp where ....;

  Was this answer useful?  Yes

Srini

  • Oct 10th, 2007
 

Its so distressing that no body could provide a better answer than a novice like me.

In the where clause change the order of conditions in such a way that: 
5 = value

cond1 & value =5

or value + 1 = 5

  Was this answer useful?  Yes

One way is to diable the index on the column using syntax

Alter index indexname on table_name disable.

One way is to apply  /*+no_index */ hint to the query

For eg: select ename /*+no_index */
from emp
where ename ='smith'

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions