zoukankan      html  css  js  c++  java
  • 选择率,基数计算公式

    单个谓词过滤:
    =  基数计算公式 :1/num_distinct*(num_rows-num_nulls),如果有直方图,基数计算公式=(num_rows-num_nulls)*density
    >  基数计算公式:(high_value-limit)/(high_value-low_value)*(num_rows-num_nulls)
    >=基数计算公式:((high_value-limit)/(high_value-low_value)+1/num_distinct)*(num_rows-num_nulls)     因为有=,所以要加上=的选择率,=的选择率为1/num_distinct
    <  基数计算公式:(limit-low_value)/(high_value-low_value)*(num_rows-num_nulls)
    <=基数计算公式:((limit-low_value)/(high_value-low_value)+1/num_distinct)*(num_rows-num_nulls)
    between ... and .... 的基数计算公式等价于 xxx<= high_limit ,xxxx>=low_limit
        基数计算公式:((high_limit-low_limit)/(high_value-low_value)+2/num_distinct)*(num_rows-num_nulls)
    low_limit<   and < high_limit 基数计算公式:(high_limit-low_limit)/(high_value-low_value)*(num_rows-num_nulls)
    low_limit<= and <high_limit 基数计算公式:(high_limit-low_limit)/(high_value-low_value)+1/num_distinct)*(num_rows-num_nulls)
    双谓词,多谓词
    A AND B 选择率计算公式=A选择率*B选择率
    A OR B   选择率计算公式=A+B-A AND B
    NOT A 选择率计算公式= 1- A选择率
    -------先到这里,以后继续更新---------

  • 相关阅读:
    c11---位运算相关
    c10---多文件开发
    C9---include,编译
    c8---递归
    c7---函数
    c6----函数的声明和实现
    c5
    Arm 环境上面libgdiplus的简单安装配置
    批量查找可执行文件目录的简单方法
    Android常用工具类
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352194.html
Copyright © 2011-2022 走看看