Analyze table TableName compute statistics;
Analyze index IndexName compute statistics;
(Analyze does not rebuild the index)
When you encounter a query or other performance that is not good for the current table, you can analyze the corresponding table once.
1. If your table is often changed from tens of millions of to millions of and then to tens of millions of, then you need to make analysis plan periodic Table analysis, and you can analyze the index together, calculate the distribution of the data in the index, so the CBO will choose more accurate execution plan.
2. If the table structure changes and is also to be done, that is, often DML on the table needs to be analyzed, it is now recommended to use the Dbms_stats package.
The purpose of the analysis tables and indexes is to generate a better query plan for the results of the analysis by using Oracle for cost-based optimization.
Oracle Foundation Analysis Table