GBase 8a
性能调优
文章

GBase 8a 性能优化方法分享(8)避免大表进行重分布的方法

发表于2024-10-08 17:03:1353次浏览0个评论

参数说明:gcluster_hash_redistribute_join_optimize

0 = 小表拉为复制表

1 = 全部重分布

2 = 自动评估,由规则决定。

应用规则为:两表的尺寸相差不超过20% 时,使用哈希重分布JOIN;否则不使用。

例子如下:查找与指定用户使用过相同IP的人员信息。

select t1.srcip,t1.desip,t1.msisdn from cdr t1,

  (select distinct srcip from cdr where msisdn='8613787317788' and btime between '2012-06-15' and '2012-06-16')

  t2

  where t1.srcip=t2.srcip

  and t1.msisdn <> '8613787317788'

  and btime between '2012-06-15' and '2012-06-16'

默认1的查询性能

658 rows in set (Elapsed: 00:03:04.99)

修改成2的查询性能

658 rows in set (Elapsed: 00:00:17.68)

评论

登录后才可以发表评论