You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/30 15:42:24 UTC

[GitHub] [shardingsphere] cheese8 commented on pull request #18710: reduce sharding dataNodes on the same shardingStrategy - InlineShardingAlgorithm

cheese8 commented on PR #18710:
URL: https://github.com/apache/shardingsphere/pull/18710#issuecomment-1171377664

   > The route logic is too important, we need more design. Why add Comparable for sharding algorithm, the proposal of code maybe need more clear.
   
   Yeah, the route logic indeed is the most important. 
   I reorganized the idea and logic of this proposal were listed as below:
   1、Now, route0 returned the Cartesian Product on the routedDataSources X the routedTables, then we got 4 dataNodes(ds0, table0 / ds0, table1 / ds1, table0/ ds1, table1) on routedDataSources(ds0, ds1) and routedTables(table0, table1) .
   
   2、As the original issue mentioned that, while the databaseShardingStrategy the same with the tableShardingStrategy, no matter what the shardingConditionValue provided, the return of the Cartesian Product on the routedDataSources X the routedTables should be broken and reduced, then we got 2 dataNodes(ds0, table0 / ds1, table1) on routedDataSources(ds0, ds1) and routedTables(table0, table1) in this case, in other words, the database and the table should route the same suffix index on the specified shardingConditionValue.
   
   3、how to judge the databaseShardingStrategy the same with the tableShardingStrategy?
   We should compare the databaseShardingStrategy to the tableShardingStrategy, only if they are(shardingColumn and shardingAlgorithm) not null, and shardingColumn and shardingAlgorithm are both equals, especially the algorithmExpression without prefix of the shardingAlgorithm are the same, the same judged, otherwise not the same judged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org