dss
dss copied to clipboard
[dss] sort cell ids in queries
Sorts cell identifiers (usually stored in the cells column of various entities) in CRDB queries.
This is expected to reduce contention in two ways:
- similar queries will be guaranteed to access data in a similar order, helping with distributed locking
- sorted arrays may be easier to compare with the
&&operator
All queries that contain a condition of the form cells && <some_int64_array> depend on sql.CellUnionToCellIds() or sql.CellUnionToCellIdsWithValidation(), so this PR simply added slices.Sort() step to both of these methods.
First step of #814