Skip to content

perf(sql-workspace): table schema lookups are cached per table, not per query text (#1171) - #1245

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

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

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

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 SELECT on a table that had just been read still went to the catalog.

Change

  • The cache key is now (database, schema, table), from SqlTableTargetExtractor. Any query on the table reuses the lookup.
  • A query with no single target table is not cached.
  • DDL still clears the cache, as before.

Tests

generic_sql_workspace_schema_test.dart:

  • another query on the same table reuses the lookup;
  • a DDL run makes the next query on the table look it up again.

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.

…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.
@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 15.11 ms 16.64 ms +10.1% ⚠️
p90 23.52 ms 25.70 ms +9.3% ⚠️
p99 51.90 ms 56.28 ms +8.4% ⚠️
stutters 298.00 273.00 -8.4%

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

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 3f7a5ee into dev Oct 9, 2026
14 checks passed
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