considering locality when concurrent synchronize DML
Feature Request
Is your feature request related to a problem? Please describe:
currently we dispatch DML by hash, so a transaction "A" in one connection may access region "a" and "b", and transaction "B" in another connection may access region "a" and "b" also.
Describe the feature you'd like:
if we could re-distribute DML to different connections, "A" may only need to access "a", "B" may only need to access "b", so the duration will decrease.
Of course it's no need for DM to track region boundaries, only try to dispatch DML with similar PK to the same synchronize queue is enough. But when the queue is full and another one is not full, we might as well send DML to a not full queue to avoid another transaction.
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
an extreme end of this improvement is synchronize one row without transaction, if downstream enables 1pc this may help a lot.
similar PK may not result in adjacent handle, so we may need to retrieve downstream table structure first.