0
点赞
收藏
分享

微信扫一扫

GBase 8a Mpp Cluster集群产品性能优化篇之DDL

对于集群层主要指合理设定表的分布属性,以及合理选择Hash分布列。对于GNode层主要指压缩参数。

建表注意事项:
用create table as select 建立一些表时,需要注意如下:
例如:create table t2 as select * from t1 where 1=2;
这个语句无法创建出Hash列,即使表t1中有Hash列,表t2也不会有Hash列,修改为 create table t2 like t1 则会在t2中创建出与t1相同的Hash列。但是,Like关键字创建的表不能另行指定Hash列,也不能指定为复制表或者NoCopy表,这时还需要使用上面的 create table … as select … 语句,另外where 1=2还需要进行运算,全部修改为limit 0具体如下:
create table t2 distributed by (‘fx’) as select * from t1 limit 0;
create table t2 replicated as select * from t1 limit 0;
create table t2 distributed by (‘fx’) nocopies as select * from t1 limit 0;

举报

相关推荐

0 条评论