Repository navigation
perf(sql-workspace): table schema lookups are cached per table, not per query text (#1171) - #1245
Merged
Merged
Conversation
…er query text (#1171) The lookup cache was keyed by the SQL text and the columns, so another SELECT on a table we had just read still went to the catalog. The key is now (database, schema, table). A query with no single target table is not cached. DDL still clears the cache, as before.
Grid scroll benchmark
Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1171
Problem
Rows already show before the table schema is looked up, and a stale lookup is dropped. The cache, though, was keyed by the SQL text, so a different
SELECTon a table that had just been read still went to the catalog.Change
(database, schema, table), fromSqlTableTargetExtractor. Any query on the table reuses the lookup.Tests
generic_sql_workspace_schema_test.dart:Not done
The issue also asks to invalidate the cache on Refresh in the object tree. The cache lives in each workspace tab, so the tree cannot reach it yet. The issue stays open for that.