首页 > 数据库技术 > 详细

mysql中的直方图采样逻辑

时间:2018-09-15 15:47:52      阅读:143      评论:0      收藏:0      [点我收藏+]
int handler::sample_next(uchar *buf) {
  // Temporary set inited to RND, since we are calling rnd_next().
  int res = rnd_next(buf);

  std::uniform_real_distribution<double> rnd(0.0, 1.0);
  while (!res && rnd(m_random_number_engine) > (m_sampling_percentage / 100.0))
    res = rnd_next(buf);

  return res;
}

 

mysql中的直方图采样逻辑

原文:https://www.cnblogs.com/youge-OneSQL/p/9651060.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!