更新时间:2024-06-29 GMT+08:00

COLUMN STORE

表的存储方式可使用CREATE TABLE语句中的WITH(ORIENTATION=COLUMN)从ROW-STORE转换为COLUMN存储。可使用rowstoreToColumnstore参数启用/禁用此功能。

输入:CREATE TABLE,修改存储模式为 COLUMN STORE

1
2
3
4
5
6
7
CREATE MULTISET VOLATILE TABLE tab1
      ( c1 VARCHAR(30) CHARACTER SET UNICODE    
      , c2 DATE
      , ...
      )
 PRIMARY INDEX (c1, c2) 
 ON COMMIT PRESERVE ROWS;

输出

1
2
3
4
5
6
7
CREATE LOCAL TEMPORARY TABLE tab1 
     ( c1 VARCHAR(30)  
     , c2 DATE   
     , ...
     ) WITH (ORIENTATION = COLUMN)
  ON COMMIT PRESERVE ROWS 
  DISTRIBUTE BY HASH (c1, c2);