-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能否支持多字段分片 #2404
Comments
能保证两种不同分片字段计算出的值是相等的吗 |
是否相等,这个由使用人自己保证就可以,正常应该是要相等的,写入的时候肯定是用第一个分片字段,一般是查询的时候没有提供第一个分片字段的时候才会用到第二个分片字段。 |
https://github.com/MyCATApache/Mycat2 这个动态分片是你说的那种吗 |
mycat2中的动态分片应该是使用三个维度来确定一个分片信息,还不是我说的这种。比如mycat2例子中的address1表是通过addressname来计算database和table,如果addressname字段没有在查询条件中出现,database和table就无法计算出来了。我想达到的效果是,如果addressname字段没有出现可以通过条件中的其他备选字段,比如city_code来计算database和table信息(假定address1表有city_code字段)。 |
mycat2中的动态分片应该是使用三个维度来确定一个分片信息 两个维度是配置,剩下一个维度从sql中从两个字段都可以映射,最后一个映射的字段是最终值 |
#2140 和这个功能类似 |
比如一个表有createTime和orderNo两个字段,从orderNo可以分析出createTime的大概时间,能否在不指定createTime的时候根据orderNo字段来解析分片呢?
类似tableRule按如下方式配置,有限按createTime字段来解析分片,如果没有出现createTime字段则尝试按orderNo字段来解析
The text was updated successfully, but these errors were encountered: