Skip to content

perf(connections): C4, C5c, C5e, C11b, C15a-c and MySQL switch back left from #4445 #4459

Open

Description

@datlechin

Follow-up to #4445 (perf audit, connections lane). Items left out of that PR:

  • C4, read a table held behind another query on a new connection (D4 a, approved). Cut for size: needs a leave token on SessionDriverGate, a pooled re-route with its refusal rules, a waiting state on TabExecutionState, UI in ExecutingResultPane and ResultStatusReadoutView, strings and screenshots. Measured: a table open waits 8.05 s behind pg_sleep(8) in another tab, PostgreSQL and MySQL.
  • C5c, send queued PostgreSQL catalog reads as one Query. Cut: a read queue in LibPQDriverCore (medium risk). Without it each side kind takes its own lease, no extra round trip on a serial connection. Plan: refresh 7 serial reads to 4 flights, refresh.rtt_depth 9 to about 6, connect.rtt_depth 13 to 11.
  • C5e, use the SSH probe channel for the first connection. Cut: needs the hand probe through the pa-reg sshd to MySQL with connect_timeout = 2. Plan: handshake_rtts 9 to 8, channel opens 4 to 3.
  • C11b, take the browsed scope's tree lists from the schema service. Cut for size. Plan: tree_layout 6 reads to at most 1 (PostgreSQL), 5 to 0 (MySQL). Also seen on the Mac mini: when the session redial after a dropped connection lands after the tree layout, the tree reads its lists again (12 to 13 statements on MySQL).
  • C15a, skip USE on the current SQL Server database. Gated on a hand probe of dbname after USE inside EXEC; no SQL Server on the measuring Macs. Plan: page 3 to 2 statements, run 3 to 2.
  • C15b, skip the transaction probe after consecutive table reads. Implemented, then cut after review: under MySQL autocommit=0 a MyISAM read answers idle and a following InnoDB read opens a transaction, so "idle after an idle table read" hides it. A sound version keys the skip by table, which needs the table name at the withTableReadDriver callers. Plan: SQL Server page 2 to 1 statements, probes 10 to 1.
  • C15c, ask SQL Server for schema and version together at connect. Implemented, then cut: SQL Server could not be measured. SELECT SCHEMA_NAME(), @@VERSION in MSSQLPlugin.connect with MSSQLSessionIdentity and tests is in 56f6c31, in the history of perf(connections): read less of the catalog on connect, commit and database switch #4445. Plan: connect 37 to 34 statements.
  • C11a on MySQL and MariaDB: switching back to a database browsed a minute earlier still reads its whole catalog (13 statements before, 14 after on the Mac mini), while PostgreSQL went 13 to 6. An in-place switch (DatabaseManager.switchDatabase, the plugin.switchDatabase branch) never calls SchemaService.show(scope:type:), so the old database's catalog stays shown until the new load lands and keepsShownCatalog() never sees the kept one. Showing the kept catalog on that branch, as the lane and reconnect paths do, fixes both.
  • editor_commit_ddl bench (a COMMIT after CREATE TABLE keeps its refresh) is not in the db-roundtrips driver yet; unit tests pin it.

Activity

  1. added
    enhancement
    platform-macos
    on Nov 23, 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

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions