Oracle analysis table is an important part of Oracle Database Management. The following describes the knowledge of Oracle analysis table in detail.
It can be helpful.
1. Analyze SQL:
Analyze table tablename compute statistics
Equivalent to analyze table tablename compute statistics for table for all indexes for all columns
For table statistics exist in views: user_tables, all_tables, dba_tables
For all indexes statistics exist in views: user_indexes, all_indexes, dba_indexes
The statistics for all columns exist in the following attempts: user_tab_columns, all_tab_columns, dba_tab_columns
Delete analysis SQL:
Analyze table tablename delete statistics will delete all statistics
2. Role of Oracle analysis table: To make CBO-based execution plans more accurate
DBA_tables data has changed and can be compared. For details, see the official documentation:
Use the ANALYZE statement to collect non-optimizer statistics, for example,:
Collect or delete statistics about an index or index partition, table or table partition, index-organized
Table, cluster, or scalar object attribute.
Validate the structure of an index or index partition, table or table partition, index-organized table,
Cluster, or object reference (REF ).
Identify migrated and chained rows of a table or cluster.
Dbms_stats is mainly used to replace analyze's function of collecting statistics, and has been greatly enhanced in this respect.
Take analyze table table_name compute statistics as an example. The statistical information generated is stored in the user_tables view.
Select * from user_tables where table_name = table_name;
Observe the NUM_ROWS, BLOCKS, AVG_SPACE, and AVG_ROW_LEN columns and you will understand the changes.