terrymanu commented on issue #24614:
URL:
https://github.com/apache/shardingsphere/issues/24614#issuecomment-3628017252
## Problem Understanding
- You reported that in sharding-jdbc-spring-boot-starter 5.3.0, INSERT
routing traverses all columns to locate the sharding key, and you believe this
repeated traversal causes performance overhead; you prefer pre-determining the
sharding-key position and fetching the
value directly.
## Root Cause
- The current logic scans columns sequentially to check whether each is a
sharding column and then fetches the value, without caching a “sharding column
name -> column index” map or performing a single lookup. This yields an O(rows
× columns) traversal cost—a
performance characteristic rather than a functional bug.
## Analysis
- For wide tables with large batch INSERTs, repeated column scans can add
CPU/latency. Whether it is a real bottleneck depends on the workload and
environment; without data we can’t confirm this is the main hotspot.
## Conclusion
- To decide whether an optimization is needed, please share evidence that
this step is the primary performance bottleneck—e.g., CPU/latency measurements
or a flame graph showing sharding-key lookup as a significant cost. With that
data we can assess and suggest a
targeted improvement.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]