Skip to content

perf(autocomplete): run completion requests off the main thread with no wait before them - #4601

Merged
datlechin merged 2 commits into
mainfrom
perf/completion-off-main
Nov 26, 2026
Merged

datlechin merged 2 commits into
mainfrom
perf/completion-off-main

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • A table page on PostgreSQL, MySQL, MariaDB and SQLite now reads a large text, JSON, jsonb or XML value as its first 256 characters plus its byte length, and a large binary value as its length alone. The full value is read by primary key when the cell is opened, copied, edited or exported, as perf(data-grid): load large MySQL binary values only when a cell needs them #3758 does for MySQL BLOBs.
  • Each engine declares its size and head functions as LargeValueFunctions in its curated metadata, replacing binaryLengthFunction. KingbaseES keeps reading every value whole.
  • A column whose declared size fits under the limit, such as varchar(255), stays a plain column. SQLite does not enforce declared sizes, so there it is deferred too.
  • On PostgreSQL a jsonb, json or xml value over the limit as stored is cut without building its text; only a smaller one is measured as text.
  • The fold cuts the trailing size and head columns off each row in place instead of copying every row, and gives a deferred column the table's origin, since engines report none for the CASE expression. Without it, external masking hid the whole column.
  • A pending change whose pre-image holds a cut value takes the loaded value once it arrives. Before, only a NULL placeholder was replaced, so undoing a save could write the 256-character head back.
  • Find > Replace All skips a cut value. It never wrote one, but it counted it.
  • The AI chat summary shows a cut value's first characters instead of its size.
  • The connection editor's Binary Value Limit is now Large Value Limit.
  • Docs: TableProApp/docs draft PR DOCS_PR.

Left for later, posted on #4525: query tabs, SQLite readValues on macOS, and the head and cut flag in the columnar store (#4521).

Test plan

  • UnloadedValuePlanTests: the select list per engine (MySQL text, PostgreSQL text, jsonb and bytea, SQLite text), which types are deferred, declared sizes, the fold keeping heads and the table's types, deferred origins.
  • UnloadedValueWriteTests: an edit next to a cut text writes only the edited column by key, and loading the text replaces its head in the pre-image, for an update and for a delete.
  • GridFindEngineTests: Replace All leaves a cut value alone.
  • TableRowsUnloadedValueTests: the grid shows a cut text's head with an ellipsis.
  • ConnectionEditorEngineIssueTests changed on purpose: PostgreSQL now has the limit row, so the "engine without the row" case uses SQL Server.
  • Ran these with UnloadedValueReaderTests, UnloadedValueLoadTests, UnloadedValueExportTests, UnloadedValueFirstLoadTests, ColumnCatalogLoadTests, TableRowsSparseStateTests, DataGridEditingTests, InlineEditEligibilityTests, MaskingGridTests, MaskingExportTests and SaveAttributionTests: all pass.
  • Reviewed by independent Claude reviewers, each given only the diff and the issue, since the Codex reviewer is at its usage limit.
  • Not measured on a live server yet: bytes per page, phys_footprint and first paint for the issue's big_cells tables.

Closes #4525

…no wait before them

The request slept 50 ms, then ran analysis, candidate collection and every catalog read on the main actor. The provider is now Sendable with an @Concurrent session, the wait is gone, an open popup runs one refresh at a time and asks again for the newest caret, the trace begins on the key, and the per-key prefix read and trigger check stop copying the document.

Closes #4539
@datlechin
datlechin enabled auto-merge (squash) November 26, 2026 04:22
@datlechin
datlechin merged commit 9c5bfa3 into main Nov 26, 2026
11 checks passed
@datlechin
datlechin deleted the perf/completion-off-main branch November 27, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(results): read large text, json and blob cells as a head and a length

1 participant