Solved

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

Posted on 2000-06-20
3
390 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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
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.

829 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