apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.76k stars 6.69k forks source link

single table can not join with sharding table #25251

Open young138120 opened 1 year ago

young138120 commented 1 year ago

version: 5.3.2

backgroud: i have big many tables with more than 100 million rows in database_a,i want split those tables by year ,and move it to anther databases like database_2020,databse_2021,database_2022。

i use shardingsphere proxy server to sharding select , i don't execute any insert or update dml now ,i set database_a datasource to single table datasource , you know many of other table in databse_a exclude big table. i run join sql with singe table and sharding table , proxy server will scan all of sharding table like this: image

i get some advice from sphereEx , i need to change single table to broadcast table ,because of single table can not join with sharding table。

so how can i design it ?

tuichenchuxin commented 1 year ago

Sharding table can't join with single table with different database. If your single table data is not big enough, you can try to change it to broadcast table.

young138120 commented 1 year ago

Sharding table can't join with single table with different database. If your single table data is not big enough, you can try to change it to broadcast table. i know that now it is question if i change singe table to broadcast table ,i need to maintenance all of broadcase table on all sharding database it is so sad

is there other way to resolve it ?

tuichenchuxin commented 1 year ago

use experimental features federation

young138120 commented 1 year ago

use experimental features federation

i already tried it ,not work for me you can find configuration here https://github.com/apache/shardingsphere/issues/25260#issuecomment-1518925033