apache / shardingsphere

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

When routing, first traverse all columns, find the partition key, get the index of the partition key in the set, and get the value of the partition bias according to the index #24614

Open 374639131 opened 1 year ago

374639131 commented 1 year ago

org.apache.shardingsphere sharding-jdbc-spring-boot-starter 5.3.0

lhc2 lhc

When routing, first traverse all columns, find the partition key, get the index of the partition key in the set, and get the value of the partition bias according to the index。

This will greatly improve the performance

RaigorJiang commented 1 year ago

@374639131 Thanks for your feedback, would you like to submit a PR?

374639131 commented 1 year ago

feedback I want to know why sharding jdbc traverses columns many times?

374639131 commented 1 year ago

@374639131 Thanks for your feedback, would you like to submit a PR?

@374639131 Thanks for your feedback, would you like to submit a PR?

I found that it takes a lot of time to find the partition key