Find useless indexes in Oracle to improve DML performance __oracle

Source: Internet
Author: User
2007-03-07 12:25
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:
QUOTE:

Set pages 999;

Set heading off;

Spoolrun_monitor.sql

Select

' Alter index ' | | owner| | '. ' | | index_name| | ' monitoring usage; '

From

Dba_indexes

where

Owner not 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.
QUOTE:

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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.