数据仓库服务 GAUSSDB(DWS)-ANALYZE | ANALYSE:示例

时间:2024-12-24 10:32:41

示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
DROP TABLE IF EXISTS CUSTOMER;
CREATE TABLE CUSTOMER
(    
    C_CUSTKEY     BIGINT NOT NULL CONSTRAINT C_CUSTKEY_pk PRIMARY KEY  , 
    C_NAME        VARCHAR(25)  , 
    C_ADDRESS     VARCHAR(40)  , 
    C_NATIONKEY   INT          , 
    C_PHONE       CHAR(15)     , 
    C_ACCTBAL     DECIMAL(15,2)  
)
DISTRIBUTE BY HASH(C_CUSTKEY);
使用ANALYZE语句更新表customer_info统计信息:
1
ANALYZE CUSTOMER;
使用ANALYZE VERBOSE语句更新表customer_info统计信息,并输出表的相关信息:
1
ANALYZE VERBOSE CUSTOMER;
support.huaweicloud.com/sqlreference-dws/dws_06_0245.html