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

opt: track schemas in the metadata #97278

Closed
DrewKimball opened this issue Feb 17, 2023 · 1 comment
Closed

opt: track schemas in the metadata #97278

DrewKimball opened this issue Feb 17, 2023 · 1 comment
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team

Comments

@DrewKimball
Copy link
Collaborator

DrewKimball commented Feb 17, 2023

Currently, the metadata only checks data sources and user-defined types when validating the query cache. We should also track the schemas that are referenced by the query (even if only indirectly), so that the cached data can be invalidated when the schema or database of a referenced object is altered or dropped. Note that this is already handled for data sources by tracking the name that was originally used to resolve the data source, but this adds complexity, and user-defined types do not handle this case at all (tracked in #96674). Tracking schemas as well as other catalog objects will simplify the implementation for data sources and UDFs (tracked in #93082 and #93321), it will also fix the caching bugs for UDTs.

Jira issue: CRDB-24605

Epic: CRDB-20535

@DrewKimball DrewKimball added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Feb 17, 2023
@DrewKimball DrewKimball self-assigned this Feb 17, 2023
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Feb 17, 2023
DrewKimball added a commit to DrewKimball/cockroach that referenced this issue Feb 22, 2023
This commit refactors the metadata dependency tracking to only refer to
data sources by ID. This simplifies the re-check that is performed when
validating the query cache. It is made possible by the previous commit,
which enabled the metadata to track changes to schemas and databases.

Fixes cockroachdb#97278

Release note: None
DrewKimball added a commit to DrewKimball/cockroach that referenced this issue Feb 27, 2023
This commit refactors the metadata dependency tracking to only refer to
data sources by ID. This simplifies the re-check that is performed when
validating the query cache. It is made possible by the previous commit,
which enabled the metadata to track changes to schemas and databases.

Fixes cockroachdb#97278

Release note: None
DrewKimball added a commit to DrewKimball/cockroach that referenced this issue Feb 28, 2023
This commit refactors the metadata dependency tracking to only refer to
data sources by ID. This simplifies the re-check that is performed when
validating the query cache. It is made possible by the previous commit,
which enabled the metadata to track changes to schemas and databases.

Fixes cockroachdb#97278

Release note: None
@DrewKimball
Copy link
Collaborator Author

Closing, because this solution didn't end up being as clean as I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team
Projects
Archived in project
Development

No branches or pull requests

1 participant