Skip to content

perf(sql-workspace): rows show before the table schema lookup, schema cache (#1171) - #1190

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1171-table-schema-cache
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1171-table-schema-cache

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1171

Changes

  • After a query the rows show at once. The table schema (primary keys, column types, edit hint, save state) is applied when it arrives, from a session cache or from the delegate in the background. An answer for a result the tab has already left is dropped.
  • The cache is keyed by the statement and its result columns. It is cleared after any statement that is not a read (select, with, values, show, explain, pragma, describe), so a table changed by DDL is looked up again.
  • Tests: rows show while the schema lookup never completes; the same query is not looked up twice.

Not in this PR

  • Clearing the cache on Refresh in the connection tree: the workspace does not reach the tree. The cache also goes away with the tab.
  • The DDL-clears-cache path has no test yet; it needs a way to change the editor text in a widget test.
  • Background resolution for MySQL and SQLite is shared code in the workspace, so it applies there too; the dialect-specific lookups are not measured.

… cache (#1171)

After a query the rows are shown at once. The table schema (keys, column types,
edit hint, save state) is applied when it arrives: from a session cache keyed
by the statement and its columns, or from the delegate in the background. An
answer for a result the tab has left is dropped. The cache is cleared after any
statement that is not a read, so a table altered by DDL is looked up again.
@github-actions github-actions Bot added editor Code/SQL editor performance Theme parser epic label: performance P2 Medium priority / Parity & Refactoring labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Grid scroll benchmark

metric base PR change
p50 16.95 ms 16.54 ms -2.4%
p90 24.82 ms 29.47 ms +18.7% ⚠️
p99 54.40 ms 57.83 ms +6.3% ⚠️
stutters 271.00 264.00 -2.6%

Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 673b1e8 into dev Oct 9, 2026
14 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1171-table-schema-cache branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor Code/SQL editor P2 Medium priority / Parity & Refactoring performance Theme parser epic label: performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant