server,ui: surface query metadata as top-level fields on StatementDetailsResponse#169971
Merged
trunk-io[bot] merged 5 commits intoMay 13, 2026
Merged
Conversation
Contributor
|
😎 Merged successfully - details. |
Member
|
Detected infrastructure failure (matched: self-hosted runner lost communication with the server). Automatically rerunning failed jobs. (run link) |
edfdefc to
cc23ac5
Compare
…Response Add top-level query, query_summary, and database string fields to StatementDetailsResponse. These will be populated from the dedicated columns on the statement statistics views in a follow-up commit. Release note: None
…umns Once V26_3 is active, getTotalStatementDetails projects the dedicated query, query_summary, and database columns from the source statement statistics view (activity / persisted / combined), and getStatementDetails sets the corresponding top-level fields on StatementDetailsResponse. Pre-V26_3, the new fields are left empty so consumers continue to read the deprecated metadata.query / metadata.databases fields. Release note: None
…elpers Add three small resolvers that prefer the new top-level Query / QuerySummary / Database fields on StatementDetailsResponse and fall back to the deprecated AggregatedStatementMetadata fields. Used by callers in the statement details page in subsequent commits. Release note: None
…elds Switch the statement details overview, explain plan, and plans table to read query / database from the new top-level fields on StatementDetailsResponse via resolveQuery / resolveDatabase. The deprecated AggregatedStatementMetadata.query / .databases reads remain as a fallback inside the resolvers for compatibility with older servers. Database is threaded down to PlanDetails / PlanTable / makeExplainPlanColumns as a prop (it is invariant across plans for a given fingerprint), replacing the per-plan plan.metadata.databases[0] reads. Release note: None
…xtures Set the top-level Query / QuerySummary / Database fields on the existing statement details fixtures so storybook snapshots and component tests exercise both the new and fallback (metadata) code paths. Release note: None
cc23ac5 to
2e731df
Compare
angles-n-daemons
approved these changes
May 13, 2026
Contributor
Author
|
/trunk merge tftr! |
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
Surface
query,query_summary, anddatabaseas new top-level fields onStatementDetailsResponse, sourced from the dedicated columns oncrdb_internal.statement_activity/_statistics_persisted/_statistics(which themselves coalesce fromsystem.statements). TheDB Console statement details page reads from the new fields and falls
back to the existing
AggregatedStatementMetadata.query/.databasesfor compatibility with older servers.This unblocks the next phase of stmt-stats work that stops persisting
query/database/query_summary inside the
metadataJSONB column.Approach
StatementDetailsResponse.statement_details.go) projectsmax(query),max(query_summary),max(database)from the source view ingetTotalStatementDetailsand threads them onto the response. Gated onclusterversion.V26_3so mixed-version clusters that may route the IE query to a node missing the columns don't break.resolveQuery,resolveQuerySummary,resolveDatabase) inpkg/ui/workspaces/cluster-ui/src/statementDetails/queryMetadata.tsprefer the new fields and fall back to the deprecatedmetadata.*reads.statementDetails.tsx,planDetails.tsx, andplansTable.tsxswitch to the resolvers;database(invariant per fingerprint) is threaded down as a prop instead of being read per plan.Commit structure
Five commits, each independently reviewable: proto fields, server wiring (with test), UI resolvers, UI consumer updates, fixture updates.
Epic: none
Release note: None