tencent cloud

문서Data Lake Compute

ANALYZE TABLES

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-08-07 17:19:54

Description

Supported engines: Presto and SparkSQL
Purpose: Perform statistics on a database table.

Statement

ANALYZE TABLES [ { FROM | IN } database_name ] COMPUTE STATISTICS [ NOSCAN ]

ANALYZE TABLE table_identifier
[ PARTITION ( partition_col_name [ = partition_col_val ] [ , ... ] ) ]
COMPUTE STATISTICS [ NOSCAN | FOR COLUMNS col [ , ... ] | FOR ALL COLUMNS ]

Parameter

database_name: Name of the database on which table statistics are performed.
table_identifier: Name of the table on which statistics are performed.
partition_col_name: Name of the column in the partitioned table on which statistics are performed.
partition_col_value: Values in the column of the partitioned table on which statistics are performed.

Example

ANALYZE TABLE students COMPUTE STATISTICS
ANALYZE TABLE students COMPUTE STATISTICS FOR COLUMNS name
ANALYZE TABLE db.students COMPUTE STATISTICS FOR COLUMNS name
ANALYZE TABLE students COMPUTE STATISTICS NOSCAN
ANALYZE TABLE students COMPUTE STATISTICS FOR all COLUMNS
ANALYZE TABLE db.students COMPUTE STATISTICS FOR all COLUMNS
ANALYZE TABLE students PARTITION (student_id) COMPUTE STATISTICS
ANALYZE TABLE students PARTITION (student_id = 111111) COMPUTE STATISTICS
ANALYZE TABLE db.students PARTITION (student_id = 111111, name = 'test') COMPUTE STATISTICS FOR all COLUMNS

ANALYZE TABLES COMPUTE STATISTICS
ANALYZE TABLES COMPUTE STATISTICS NOSCAN
ANALYZE TABLES from school_db COMPUTE STATISTICS NOSCAN
ANALYZE TABLES IN school_db COMPUTE STATISTICS NOSCAN




도움말 및 지원

문제 해결에 도움이 되었나요?

피드백