Repository navigation
perf(grid): read less on table open, save and query-tab SELECT - #4458
Merged
Merged
Conversation
…and reread a catalog whose schema list failed
…he SQL Server connect as it was; move completion facts with a schema switch
…r's transaction, and reread a hierarchical catalog whose read failed
…committed the tables
…ove rows by itself" This reverts commit 1edfee5.
…eshes, and match names by bytes
…e the agent a database file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Perf audit 2026-11-22b, table-open-save lane: findings 10 and 22, items TOS-A to TOS-I, decisions D8 and D9.
readsCheckListsFromDDL, is off for PostgreSQL, PGlite, MySQL, MariaDB, SQLite, SQL Server, ClickHouse and DuckDB, whose stored DDL never matches the parser or whose driver answers itself. Every other engine, curated or not, keeps the read.allowedValuesfrom the CREATE statement it already reads:col IN ('a', 'b')as a column or table check, any name quoting, ASCII case folded. A column with two such lists gets none. A list with anything but quoted literals and bare NULLs gives no picker on either parser, so a numeric list no longer offers blank entries.executeUserQuery(a read with parameters, Share Result) runs to its end and decodes only cap + 1 rows, where it decoded up to 5,000,000. AnINSERT ... RETURNINGstill writes and counts every row.USE.Measurements
Mac mini, interleaved before, after, after, before. Before is the audit base
9d0d481cf1(Release, universal); after is this branch at 5cebd5a (build.sh app arm64 --unsigned), on top of #4445. Load1 22 to 250 while other lanes built, so the table holds statement counts and depth, which load does not move.db-roundtrips --sessions main, count phase through the 0 ms proxy, wall phase at 200 ms RTT.open_table, statementsopen_table_secondopen_table_nopkeditor_queryeditor_query, depth after Run at 200 msopen_table, depth after the click at 200 msedit_save, statements after COMMITopen_tableeditor_queryedit_save(noUSE, no count)refreshopen_tableon PostgreSQL: the DDL read (constraints_table,table_props_table) and the table's own FK read (fk_table). The estimate stays, read once by the count.open_table_second,open_table_nopkandeditor_commitwindows misattributed in both builds under this load (1 and 10, 6 and 0); they are left out.edit_savesends the savepoint probe before its BEGIN (2 statements before the write, was 1), once per connection; the count after COMMIT is gone, so the depth stays 5.rt_orders(100,000 rows, the count threshold) runs no count now: the save keeps "~100,000", and a filtered table at the threshold is not counted automatically, as on a fresh open.Parameterized read,
SELECT * FROM bench_typical WHERE id > :min(1,000,000 rows, cap 100,000),dt.py tp-session-grid --only-ph02with the Run pressed twice (a lane copy of the harness), n=2 each:Tests changed on purpose
ShareResultRequestTests: "A result cut short sends its exact count" and "An estimate above the rows held stands in for the total" become "A query result cut short shares no total, though the tab holds a count of the table" and "A whole query result is its own total, though the tab holds a count of the table" (D8).QueryExecutorTests"parseSchemaMetadata maps columns, foreign keys, primary keys" and two empty-input cases drop their estimate assertions: the definition read no longer carries one (TOS-D). Fixtures inParseSchemaMetadataTests,SchemaMetadataGeneratedColumnTests,Phase2WorkCancellationTestsandCatalogChangeWindowTestsdrop the field.LibPQStopBeforeStatementTests"A Stop during the savepoint probe sends none of the user's statement and reports cancelled" runs the user's BEGIN instead of a read, same expectation (TOS-G). "A Stop during the cursor read's savepoint..." gets its probe from that BEGIN.MySQLDatabaseMoveScanTests"Anything else proves nothing" no longer listsCOMMIT(TOS-H).Deliberately not fixed here
ON CONFLICT REPLACE, a PostgreSQL rule, a row-level security policy, a trigger list kept from a refresh whose trigger read failed.RETURNING. A capped read with parameters still drains on the wire; it decodes only cap + 1 rows.allowedValues: found by the plan, outside this lane.Test plan
verify.sh buildandverify.sh pluginspass;PluginMetadataCuratedParityTestspasses with every plugin built.verify.sh test, the whole Unit plan: 33,484 run, 0 failed.verify.sh ios SQLiteDriverFileTests ExportTwinNameTests QueryCompletionCatalogTests: 66 pass (the SQLite plugin compiles into the iOS app).CheckListDDLReadTests), the SQLite CHECK parser (SQLiteCheckValueListTests,SQLiteCatalogReadsTests), query tabs counting nothing and paging untouched (QueryTabCountsNothingTests), the save effect (SavedRowsCountEffectTests), keys before the estimate, the catalog's view vouching and listed FKs (DefinitionReadEstimateTests,SchemaForeignKeyStoreTests), composite FK parity (PostgreSQL, SQLite), capped reads, drains and the savepoint probe on the scripted server (LibPQCappedUserReadTests,LibPQSavepointProbeTests), SQLite capped writes locally and through the SSH agent, the MySQL save proof.Docs: TableProApp/docs#277