Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dss] sort cell ids in queries #1112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shastick
Copy link
Contributor

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

@Shastick Shastick force-pushed the contention-id-sorting branch from ce4e2ac to ec8d645 Compare September 12, 2024 14:23
Copy link
Contributor

@barroco barroco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide evidence of the expected improvement ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants