ANALYZE | ANALYSE
Function
Collects statistics about table contents in databases. The statistical results are stored in LakeFormation. The execution plan generator uses this statistical data to determine the most efficient execution plan.
Users capable of executing ANALYZE on a specific table include the table's owner and users granted read permissions on the table.
Precautions
ANALYZE scans data in the table and generates billing records.
Syntax
1 | { ANALYZE | ANALYSE } table_name; |
Collect statistics about a specific partition in a partitioned table.
1 | { ANALYZE | ANALYSE } table_name (predicate_condition); |
Parameter Description
- table_name
Name of the specific table to be analyzed (may include schema qualification).
Range: an existing table name.
- predicate_condition
Partitioning predicate condition.
Range: correct partition definitions and corresponding partition values.
Examples
1 | ANALYZE customer_info; |
1 2 3 4 5 6 7 8 9 | CREATE TABLE partition_customer_info (a char(3),c date, d text) partition by (b bigint, month(c), bucket(3,d)) store as iceberg; -- Assume partitions exist: b=1, c_month=2024-05, d_bucket=5 ANALYZE partition_customer_info (b=1,month(c)='2024-05',bucket(3,d)=5); CREATE TABLE partition_customer_info (a char(3),c date) partition by (b bigint, e text) store as parquet; -- Assume partitions exist: b=1, e='abcd' ANALYZE partition_customer_info (b=1,e='abcd'); -- Assume partitions exist: b=2, e=null ANALYZE partition_customer_info (b=1,e is NULL); |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot