If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Hint to skip index?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-03, 06:33
umciggy umciggy is offline
Registered User
 
Join Date: Jan 2003
Posts: 16
Hint to skip index?

Hi!

I'm in the proccess of tuning some sql queries. Is there some way I can hint ( /*+ */ ) oracle to skip using an index when executing a query?

/Mattias
Reply With Quote
  #2 (permalink)  
Old 01-08-03, 06:49
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Hint to skip index?

Quote:
Originally posted by umciggy
Hi!

I'm in the proccess of tuning some sql queries. Is there some way I can hint ( /*+ */ ) oracle to skip using an index when executing a query?

/Mattias
You can use the FULL hint with the alias of the table whose index you want to ignore, e.g.
SELECT /*+ FULL(e) */ empno, ename
FROM emp e
WHERE deptno = 123;

Of course, it's only a hint so Oracle may choose to ignore it.

An alternative is to experiment with the optimizer_index_cost_adj parameter- see here:

http://technet.oracle.com/docs/produ...htm#REFRN10143
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 01-08-03, 07:31
umciggy umciggy is offline
Registered User
 
Join Date: Jan 2003
Posts: 16
Re: Hint to skip index?

Quote:
Originally posted by andrewst
You can use the FULL hint with the alias of the table whose index you want to ignore, e.g.
SELECT /*+ FULL(e) */ empno, ename
FROM emp e
WHERE deptno = 123;

Of course, it's only a hint so Oracle may choose to ignore it.

An alternative is to experiment with the optimizer_index_cost_adj parameter- see here:

http://technet.oracle.com/docs/produ...htm#REFRN10143
Did the trick. Great, thanks!
Reply With Quote
  #4 (permalink)  
Old 01-08-03, 18:47
clio_usa clio_usa is offline
Registered User
 
Join Date: Apr 2002
Location: California, USA
Posts: 482
Cool

By rule - RBO uses the latest table statistics to prepare the execution plan for a query. If you delete the statistics for particular table, then the RBO will force FTS (no index use in this case).

There is a package DBMS_STATS which allows you to manipulate the statistics - export first, then delete then, then import back. Of course you can also gather them as well.


Hope that helps,

clio_usa - OCP - DBA

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On