docs: Complete the scoped freshness CCDF query - #38378
Merged
Merged
Conversation
The "Summarize freshness with a CCDF" section showed the per-object variant as a bare fragment starting at `FROM`, with no `SELECT`, no enclosing `lags` CTE, and no outer aggregation. Pasting it into psql fails with "Unexpected keyword FROM at the beginning of a statement", so a reader had to reassemble the statement by hand from the aggregate query above it. Show the whole statement instead, matching every other code block on the page, and reword the lead-in so it describes the query rather than reading as a patch instruction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H48CHtCVFAmZ3L6JHJeTWB
maheshwarip
enabled auto-merge (squash)
August 21, 2026 14:12
Contributor
Author
|
@sjwiesman could I get a quick 👍🏾 on this one? |
sjwiesman
approved these changes
Aug 21, 2026
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.
Motivation
On How to monitor freshness, the last code block in the "Summarize freshness with a CCDF" section is incomplete. It shows only the middle of the statement (the object-name placeholder below is spelled
MV_NAMEhere, and appears in the page as that name wrapped in angle brackets):It starts mid-statement at
FROM, drops theSELECT extract(epoch FROM wl.lag) AS lag_secondsline that theFROMbelongs to, and has no enclosingWITH lags AS (, nothresholdsCTE, and no outer aggregation. Running it verbatim fails:A reader has to reassemble the statement by hand from the aggregate query further up the page. Every other code block on this page is a complete, runnable statement, so this one is the odd one out.
Description
Show the whole statement in the block, so it can be copied and run directly, and reword the lead-in sentence so it describes the query that follows rather than reading as a patch instruction ("add a join ... to the
lagsCTE" becomes "joinmz_catalog.mz_objectsin thelagsCTE and filter on the object name").The SQL is unchanged from what the fragment implied: the
lagsCTE gains the join tomz_catalog.mz_objectsand the object-name filter, and the rest of the query matches the aggregate version above it.mz_wallclock_global_lag_recent_history.object_idis documented as corresponding tomz_objects.id, so the join key is correct. The placeholder in the page is left exactly as it was.Verification
Manual, against a local
environmentdbuilt from this branch with a materialized view producing wallclock lag history.ERROR: Unexpected keyword FROM at the beginning of a statement(exit 3).mzsqlblocks (the per-object lag history query and the aggregate CCDF) to confirm they were already complete and still run clean.Docs-only change, so no automated tests were added or modified.
Release notes
No release note. This is a documentation-only fix with no user-visible product change.