gp查看表的分布键

查看分布键
select n.nspname AS "模式名",c.relname AS "表名",case when p.policytype='p' then '分区表' when p.policytype='r' then '复制分布' end "分布策略", pg_get_table_distributedby(c.oid) "分布键" ,c.reloptions "压缩类型" from pg_class c left join gp_distribution_policy p on c.oid=p.localoid left join pg_namespace n on c.relnamespace=n.oid where n.nspname like '%tenant%' --and c.relname='test'
重分布
执行就回收空间
alter table tenant_123234_biz.dm_ra_skc_org_detail set with (reorganize=true) distributed by (skc_sk);

更新统计信息
analysetenant_123234_biz.dm_ra_skc_org_detail;

posted @ 2024-10-08 14:53  新锐克  阅读(246)  评论(0)    收藏  举报