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

Use cache for database schema in get_schema() #69

Open
ligurio opened this issue Jul 29, 2021 · 1 comment
Open

Use cache for database schema in get_schema() #69

ligurio opened this issue Jul 29, 2021 · 1 comment
Labels
feature A new functionality in design

Comments

@ligurio
Copy link
Member

ligurio commented Jul 29, 2021

CRUD will use DDL schema to obtain a sharding key using get_schema(). However, on every get_schema() call DDL module scan spaces to build the current database schema. Need to cache a database schema.

@ligurio ligurio self-assigned this Jul 29, 2021
ligurio added a commit that referenced this issue Jul 29, 2021
@Totktonada
Copy link
Member

Sadly, we have no public API for tracking a database schema version (without it there is no way to invalidate the cache, when some space or index is changed).

There is box.internal.schema_version(), which is obviously internal and has no guarantee that it'll exist in a future. It exists since 1.7.3-660-gcbfc235ee. We can take risks, use the internal function, file issue to expose it publicly (should be easy to implement and unlikely someone will be against). When it'll be exposed publicly, use the public function and fallback to the internal one if the public one does not exist.

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

No branches or pull requests

4 participants