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