Skip to content

perf(sql-workspace): results wait for a schema lookup on every query; cache table schema #1171

Description

@ZhuchkaTriplesix

Problem

After every query, GenericSqlWorkspace.execute awaits delegate.resolveTableSchema(userSql, cols) before the rows are shown. For PostgreSQL this calls conn.getTableSchema(...), at least one catalog query, on every SELECT … FROM t, also when the same table was queried a second ago. Over an SSH tunnel or to a remote server this adds a full round trip (or more) to every result.

Scope

  • Show rows as soon as executeQuery returns; resolve PKs / types in the background and enable Save / edit hints when they arrive (the tab may already show another result: drop stale answers by generation).
  • Cache TableSchema per (connection, database, schema, table) for the session; invalidate on DDL run in the same workspace (DestructiveSqlDetector / classifier already knows DDL) and on Refresh in the tree.
  • Same for MySQL and SQLite delegates.

Acceptance

  • Rows render without waiting for the schema lookup (test with a fake delegate whose resolveTableSchema never completes).
  • Re-running a query on the same table does not query the catalog again; after ALTER TABLE it does.

Activity

  1. added
    editorCode/SQL editor
    performanceTheme parser epic label: performance
    P2Medium priority / Parity & Refactoring
    on Oct 8, 2026
  2. added a commit that references this issue on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringeditorCode/SQL editorperformanceTheme parser epic label: performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions