ITPub博客

首页 > > > mysql中的直方图采样逻辑

mysql中的直方图采样逻辑

作者:友哥 时间:2018-09-15 15:29:00 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;
}

 

原文作者:;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-05-20

  • 博文量
    276
  • 访问量
    1000