应用场景: 由于业务的需求,每天按照分公司抽取事实表t的数据生成报表,抽取的逻辑精简之后如下: select * from fact_table t where t.date between '$date1' and '$date2' and (t.a = '$para' or t.b = '$para' or t.c = '$para' or t.d = '$para' or t.f = '$para')
当然不合适啊!索引建多了,特别是建立在重复项比较多的字段上,影响性能,分公司应该是一个字段,然后创建一个36的那个字段,进行partitioning key(主键)not logged initially,select * from t where t.date >='$date' and t.date...显示全部
当然不合适啊!索引建多了,特别是建立在重复项比较多的字段上,影响性能,分公司应该是一个字段,然后创建一个36的那个字段,进行partitioning key(主键)not logged initially, select * from t where t.date >='$date' and t.date<='$date' and 分公司 in('')收起