Oracle resolves index fragmentation features

Source: Internet
Author: User

When we started to insert large amounts of data into an empty indexed table, there was no fragmentation problem, but after a long period of additions and deletions, the database will inevitably have fragmentation problems that affect the performance of the database, and Oracle has its own solution to this problem.

Here are some solutions to this problem:

The first thing to do is to analyze the index:analyze index ind_1 validate structure; Ind_1 the index you set up for yourself

After analysis, query several main parameters to determine whether to defragment:select Name,height,pct_used,del_lf_rows/lf_rows from Index_stats;

Here are some criteria for determining if a fragment needs to be sorted:

1.height>=4

2.pct_used<50%

3.del_rows/lf_rows>0.2

If you query to a value that matches either of the three cases above, it means we need to defragment.

Defragmentation statement:ALTER index IND_1 rebuild [online] [tablespace name];

In general, it is necessary to add the online parameter, do not add tablespace name.

The above is an understanding of Oracle's ability to resolve index fragmentation.

Oracle resolves index fragmentation features

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.