Skip to content

Measure the sidebar, Open Quickly and autocomplete on 100 schemas and 50,000 tables #3661

Closed

Description

@datlechin

Problem

Some users work in databases with many schemas, for example one per tenant with the same table names in each (#3431). Nothing in TablePro tests or times the sidebar, Open Quickly or autocomplete on a catalog that size, so a slowdown there would only show up in a user's database.

What the code and docs say today:

  • Open Quickly reads the other schemas' tables with one query per schema on every engine except PostgreSQL, PGlite, SQL Server and DuckDB (features/open-quickly.mdx, "Other schemas"). On Oracle, 100 schemas means 100 queries before the panel stops reading Loading….
  • Autocomplete keeps the columns of at most 300 tables (apple/TablePro/Core/Autocomplete/SQLSchemaProvider.swift:18) and holds the whole table list in memory (SQLSchemaProvider.swift:36).
  • The sidebar is an NSOutlineView subclass (apple/TablePro/Views/Sidebar/DatabaseTreeOutlineView.swift:92). How long it takes to list, filter and expand 50,000 tables has never been measured.

Proposed solution

  • A script that builds three fixtures: PostgreSQL with 100 schemas of 500 tables each, Oracle with the same shape, and MySQL with one database of 50,000 tables.
  • Measure on each fixture:
    • Sidebar: connect to the first full listing, one keystroke in its search field, expanding a schema.
    • Open Quickly: opening the panel, and the first result for a name that exists in every schema.
    • Autocomplete: the popup after FROM and after schema., and resident memory once the table list is loaded.
  • Set a budget for each from the first run. The main thread never blocks for more than 100 ms during any of them.
  • Fix whatever misses its budget, starting with the slowest. For the per-schema reads in Open Quickly, read every schema in one catalog query where the engine allows it.

Done when the measurements are written down with their budgets, and every step meets its budget on every fixture.

Alternatives considered

The schema filter narrows the sidebar and Open Quickly to the schemas it keeps (features/connection-window.mdx, "Filtering schemas"). It does not help someone who needs every schema.

Platform

macOS

Related database type

N/A / General

Activity

  1. self-assigned this
    on Oct 26, 2026
  2. datlechin commented on Oct 30, 2026

    @datlechin
    MemberAuthor

    Every step meets its budget on every fixture, no main-thread stall over 100 ms. Release build of main at 7cdfa2d, Mac16,11 M4 Pro, 24 GB, macOS 27.0.1, load average 4.6, 10 runs per step. Budgets are in apple/scripts/benchmark/large-catalog/baseline.json.

    fixture step median p95 max stall budget med / p95
    postgres sidebar-listing 347.3 479.5 99.2 475 / 610
    postgres sidebar-filter 72.3 79.0 78.4 95 / 120
    postgres sidebar-expand 117.1 130.7 0 450 / 720
    postgres quick-open-panel 27.4 85.0 82.0 70 / 95
    postgres quick-open-result 188.2 204.4 0 235 / 280
    postgres complete-from 82.2 86.2 0 100 / 130
    postgres complete-schema 87.9 97.6 0 130 / 345
    postgres footprint 276.7 MB 280 MB
    oracle sidebar-listing 1158.2 1374.2 82.1 1505 / 3105
    oracle sidebar-filter 83.8 225.6 85.1 135 / 590
    oracle sidebar-expand 151.5 223.3 0 320 / 415
    oracle quick-open-panel 48.2 86.9 84.5 75 / 140
    oracle quick-open-result 183.1 196.3 0 210 / 365
    oracle complete-from 83.7 89.5 0 95 / 115
    oracle complete-schema 90.8 100.4 0 525 / 675
    oracle footprint 255.7 MB 325 MB
    mysql sidebar-listing 384.3 598.3 84.6 540 / 820
    mysql sidebar-filter 73.3 83.8 88.3 120 / 140
    mysql sidebar-expand 258.9 281.9 52.9 370 / 430
    mysql quick-open-panel 46.7 72.1 71.4 85 / 115
    mysql quick-open-result 155.2 169.2 0 190 / 215
    mysql complete-from 92.5 103.1 0 115 / 135
    mysql complete-schema 107.3 116.8 0 140 / 165
    mysql footprint 287.4 MB 425 MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions