Oracle analysis table

Source: Internet
Author: User

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.

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.