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

Datastore: Immediately create/drop indices in commited state and roll back if needed #2301

Open
Centril opened this issue Feb 24, 2025 · 0 comments
Labels
backward-compatible enhancement New feature or request no runtime change This change does not affect the final binaries performance A PR/Issue related to improving performance of stdb

Comments

@Centril
Copy link
Contributor

Centril commented Feb 24, 2025

Currently, when indices are created in the tx state, we end up putting committed state rows in the tx index.
This forces us to do a bunch of unnecessary checks in hot code, whereas index creation in a transaction is, relatively speaking, incredibly rare.

It would be better to pay the cost in migrations instead and immediately change the committed state (but not in committed system tables),
and keep track of these changes, such that if the migration failed, we can roll back by removing the created indices and putting back the dropped ones. Dropping an index and putting it back should not require building anything more than we do today. We can keep dropped indices around in the tx state until we truly know that we don't need it anymore.

These changes should help both simplify the code as well as improve performance.

@Centril Centril added backward-compatible enhancement New feature or request no runtime change This change does not affect the final binaries performance A PR/Issue related to improving performance of stdb labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backward-compatible enhancement New feature or request no runtime change This change does not affect the final binaries performance A PR/Issue related to improving performance of stdb
Projects
None yet
Development

No branches or pull requests

1 participant