Solved

How to find out if an index is not being used in Oracle

Posted on 2000-06-20
3
388 Views
Last Modified: 2010-05-19
Is there a way to find out if an index is not being used in oracle.??
0
Comment
Question by:tiger20
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
sbenyo earned 50 total points
ID: 3011313
Yes.
You should run an explain plan on the query you want to check.
Explain plan shows you how oracle executes your query and what indexes are in use in the query.

To do this:

1) connect using SqlPlus.

2) run the script:

$ORACLE_HOME/rdbms/admin/utlxplan.sql

This creates the explain plan table used by oracle to create the explain plan.

2) in sqlplus:
   sqlplus>set autotrace on
   
3) Now run the query. In the explain plain oracle shows you can see if indexes are used or not.

Sample explain:

Execution Plan
----------------------------------------------------------
   0   SELECT STATEMENT Optimizer=FIRST_ROWS (Cost=1 Card=82 Bytes=
    164)

   1 0   TABLE ACCESS (FULL) OF 'DUAL' (Cost=1 Card=82 Bytes=164)

This show a table accessed without indexes (FULL).

You can also use sql trace to do that. If you want to know about it tell me.
0
 

Author Comment

by:tiger20
ID: 3011419
Answer accepted
0
 

Author Comment

by:tiger20
ID: 3011420
Cheers sbenyo that worked a treat.... Here the points .... enjoy :-)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question