Repository navigation
Stop copying a system table's metadata twice to set its comment - #115490
Conversation
Attaching a system table fetched the table back from `DatabaseCatalog` and copied its whole `StorageInMemoryMetadata` - which carries the full `ColumnsDescription` - twice, just to fill in the comment. `setInMemoryMetadataComment` replaces only the comment, and it is now set on the storage before it is attached, so there is no lookup either. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [fd06106] Summary: ✅
AI ReviewSummaryThis PR moves the system-table comment update onto the freshly constructed storage and adds Tests
Final VerdictNeeds evidence before merge. No new correctness blockers found in the current code, but the performance claim is still unproven. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 17/17 (100.00%) · Uncovered code |
|
|
||
| /// Set the comment on the storage before attaching it, so that we neither look the table back up in | ||
| /// `DatabaseCatalog` nor copy its whole metadata (including the full `ColumnsDescription`) an extra time. | ||
| storage->setInMemoryMetadataComment(comment); |
There was a problem hiding this comment.
Because this PR is filed as Performance Improvement, I think it needs a small before/after measurement in the description. The code shape clearly removes work here, but without a startup-time or allocation-profile delta it's hard to tell whether this is a measurable user-facing win or just a localized cleanup.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizes3 object files changed (-192.38 KiB total), 0 added.
737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units688 translation units recompiled, 5203 s compile time in total, 688 of them have a recent master baseline. |
|
📊 Cloud Performance Report ✅ AI verdict: This PR only changes how SYSTEM database tables are attached and get their comment set at server startup (attachSystemTablesImpl / IStorage), avoiding an extra catalog lookup and metadata copy. Nothing in that path is exercised by TPC-H query execution, so neither flagged delta can be attributed to the change. Q17's flagged +59.4% is downgraded to not_sure: the source measurements were highly variable and the query touches none of the modified code. Q7's +16.4% sits inside master's variance band and is likewise off-path, so both deltas read as run-to-run noise rather than a real PR effect. clickbench🟢 No significant changes tpch_adapted_1_officialFlagged queries (2 of 22)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
Noticed while profiling start-up for #112496.
Attaching a system table fetched the table back from
DatabaseCatalogand copied its wholeStorageInMemoryMetadata— which carries the fullColumnsDescription— twice, only to fill in the comment. Since there are ~164 system tables, every start-up copied every system table's schema two extra times.IStorage::setInMemoryMetadataCommentreplaces only the comment, and it is now applied to the storage before it is attached, so the catalog lookup goes away as well.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Attaching the system tables no longer copies each table's metadata, including its full column description, twice just to set the table comment.
Workflow [PR]
Sync PR [sync-upstream/pr/115490]
Version info
26.8.1.1833(included in26.8and later)