Skip to content

perf(data-grid): read large text, JSON and binary cells as a head and a size - #4603

Open
datlechin wants to merge 2 commits into
mainfrom
perf/large-cells-head-length
Open

datlechin wants to merge 2 commits into
mainfrom
perf/large-cells-head-length

Conversation

@datlechin

@datlechin datlechin commented Nov 26, 2026 •

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.
  • A cut cell holds NULL in the row, as perf(data-grid): load large MySQL binary values only when a cell needs them #3758's do, so every reader of row values keeps its existing handling. The first characters live beside the row in TableRows, and only the grid, its column sizing and the AI chat summary show them. A masked column keeps none and shows the size.
  • Each engine declares its size and head functions as LargeValueFunctions in its curated metadata, replacing binaryLengthFunction. KingbaseES keeps reading every value whole.
  • A column that can never pass the limit stays a plain column: a declared size such as varchar(255), and MySQL's TINYTEXT, TEXT, TINYBLOB and BLOB. SQLite does not enforce declared sizes, so there a varchar(n) is deferred too.
  • On PostgreSQL a jsonb, json or xml value is cut or kept by its stored size where that settles it, so most never have their text built; only one stored between an eighth of the limit and the limit is measured as text.
  • The fold cuts the size and head columns off each row in place instead of copying every row. It gives a deferred column the table's origin, since engines report none for the CASE expression; without one, external masking hid the whole column.
  • Find offers Search All Rows when the page holds cut values, since it cannot see past their first characters. A row dragged out names a value left on the server instead of dropping it as NULL.
  • The connection editor's Binary Value Limit is now Large Value Limit.
  • Docs: docs(features): large text, JSON and binary values on four engines docs#298 (draft).

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 and bounded sizes, the fold keeping heads and the table's types, deferred origins.
  • TableRowsUnloadedValueTests: a cut text reads NULL with its head kept beside the row, a load drops the head, a masked column keeps none, and the grid shows the head with an ellipsis.
  • UnloadedValueWriteTests: an edit next to a cut text writes only the edited column by key, and the load completes the pre-image of an update and of a delete.
  • UnloadedValueFirstLoadTests, GridFindEngineTests, DataGridResponderCommandTests: the PostgreSQL first page, Replace leaving a cut value alone, the row drag.
  • Changed on purpose: ConnectionEditorEngineIssueTests and UnloadedValueFirstLoadTests/otherEngineReadsInline used PostgreSQL as the engine without deferral. They use SQL Server now.
  • Ran these with UnloadedValueReaderTests, UnloadedValueLoadTests, UnloadedValueExportTests, ColumnCatalogLoadTests, TableRowsSparseStateTests, DataGridEditingTests, InlineEditEligibilityTests, MaskingGridTests, MaskingExportTests, SaveAttributionTests and GridDatasetFindTests: all pass.
  • No screenshots: the Mac's screen was locked for this whole run, and a locked screen captures black.
  • 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.
  • Known server cost to measure there: each size test appears in the value, size and head expressions, and neither engine shares it. A MySQL JSON value, and a PostgreSQL jsonb stored between an eighth of the limit and the limit, is turned into text for each one; a cut one is turned into text twice more, for its size and head. A jsonb compressed past an eighth of its text size is read whole.

Closes #4525

… a size

A table page on PostgreSQL, MySQL, MariaDB and SQLite reads a large text, JSON, jsonb or XML value as its first 256 characters and its byte length, and a large binary value as its length. The cell holds NULL as #3758's do; the first characters live beside the row for the grid. The full value loads by key when the cell is opened, copied, edited or exported.

This branch has not been deployed

No deployments
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