DML performance is low, one of the most serious reasons is the existence of useless indexes. All SQL inserts, updates, and deletions become slower when they need to modify a large number of indexes when each row of data is changed.
Many Oracle managers will assign indexes to an SQL query if they see a column in the where statement. While this approach allows SQL to run faster, a functionally based Oracle index makes it possible for database managers to overallocated indexes on rows in a datasheet. Overallocated indexes can severely affect the performance of key Oracle data tables.
Before Oracle9i, there was no way to determine which indexes are not used by SQL queries. Let's take a look at what Oracle9i provides for you to find these indexes and delete them.
The process is quite simple. Oracle9i has a tool that allows you to use the ALTER INDEX command to monitor the use of indexes. Then you can look up these unused indexes and delete them from the database.
Here is a script that opens the monitoring function for all indexes in a system:
Set pages 999;
Set heading off;
Spoolrun_monitor.sql
Select
' alter index ' | | owner| | '. ' | | index_name| | ' monitoring usage; '
from Dba_indexes
where
owner isn't in (' SYS ', ' SYSTEM ', ' perfstat ')
;
Spool off;
@run_monitor
You'll need to wait a bit longer until you've run enough SQL statements on the database, and then you can query the new V$object_usage view.
Select
index_name,
table_name,
Mon,
used
from
v$object_usage;
In V$object_usage there is a column called used, and its value is yes or No. Unfortunately, it does not tell you how many times Oracle has used the index, but the tool is useful for finding unused indexes.