Qihoo360 / Atlas

A high-performance and stable proxy for MySQL, it is developed by Qihoo's DBA and infrastructure team
GNU General Public License v2.0
4.65k stars 1.15k forks source link

Atlas支不支持多分表关联查询? #194

Open jmbkeyes opened 5 years ago

jmbkeyes commented 5 years ago

有两张表A, B, 他们都是大数据表,将他们按各自的分表键分表之后变成了A_0, A_1, B_0, B_1. select a.name, b.name as n2 from A a INNER JOIN B b on a.xx= b.yyy where a.shardingKey=xxx and b.shardingKey=yyy

Atlas貌似最终不会生成分表 的join语句(e.g. select a.name, b.name as n2 from A_0 a inner join B_1 b on a.xx=b.yyy)