Closed dualven closed 3 years ago
那么,这种mycat2的路由算法 ,在查询的时候,一般都是范围查询,那么mycat2的路由算法 的优势 与作用在哪,一查询就会全表查询。。。。。
比如这个
"function":{
"clazz": "io.mycat.router.mycat1xfunction.PartitionByMonth",
"name": "PartitionByMonth",
"properties": {
"dateFormat": "yyyy-MM-dd hh:mm:ss",
"beginDate": "2021-01-01 00:00:00",
"endDate": "",
"columnName": "create_time"
},
"ranges":{}
},
就支持范围查询
mycat2默认的hash算法是与云上DRDS,比如华为DDM和阿里云PolarDB-X数据库一致的,一般来说,hash算法不支持范围查询,对于一些情况是可以范围查询的,但是现在没有实现.
业务查询SQL的使用方式,是看系统怎么设计的,mycat是尽可能都支持,自动分片,自定义分片,根据不同的算法特性支持分区剪裁.
Describe the bug
To Reproduce Steps to reproduce the behavior:
explain select * from mesh_info_topo where create_time > "2021-10-01 00:00:00" and create_time < "2021-10-02 00:00:00";
只有=的精确查询,才是路由到一张表,这有啥用呢,我们一般用的都是范围查询啊