基础属性的设置
distribution_key
指定分布列,数据将按照指定列,shuffle到各个shard
set_table_property('public.dwd_intl_trd_pay_itm_buyer_ri', 'distribution_key', 'stat_
date,stat_hour,brand_id,seller_id');
clustering_key
指定一些列作为聚簇索引
set_table_property('public.dwd_intl_trd_pay_itm_buyer_ri‘, 'clustering_key‘,'stat_date,stat_hour,cate_id');
segement_key
文件索引,数据按该索引划分文件,可以通过segement_key快速索引到某一文件
set_table_property('public.dwd_intl_trd_pay_itm_buyer_ri', 'segment_key', 'stat_date,stat_hour,bu_id,bu_id_level1,bu_id_level2,cate_id');
高级属性的设置
设置合理的TableGroup
Table Group非常关键的作用就是做local join,从而大大提升join效率,尤其是多表和比较大数据量join的时候
call set_table_property('public.dwd_intl_trd_pay_itm_buyer_ri', 'colocate_with', 'public.dwd_intl_log_ipv_itm_visitor_ri');
设置Shard_count
数据量:7亿/230GB的数据量,设置在2Kcore左右,交易30和流量50
实例资源:1个shard至少需要1个core来负责计算
写入性能:根据交易和流量的RPS来指定
Join需求:有夺标join的查询case时,需要考虑TableGroup
sql
CALL set_table_property('public.dwd_intl_trd_pay_itm_buyer_ri', 'shard_count', '30');
CALL set_table_property('public.dwd_intl_log_ipv_itm_visitor_ri', 'shard_count', '30');
支持多种索引
目前支持字典索引和位图索引。可以通过“dictionary_encoding_columns"和“bitmap_columns"来指定需要索引的列。