Conversation
New SQL reference page for the SUBSAMPLE clause covering LTTB, M4, and MinMax downsampling algorithms with SVG diagrams, runnable examples on fx_trades, gap-preserving LTTB, and configuration reference.
|
🚀 Build success! Latest successful preview: https://preview-424--questdb-documentation.netlify.app/docs/ Commit SHA: ba17488
|
Avoid stretching all doc images by targeting only img[src*="/subsample/"] instead of article img.
Split gap SVG into three separate charts with individual legends. Add small gap to dataset to illustrate threshold behavior. Use QuestDB color palette (pink lines, cyan titles, gray dots). Match inline SQL examples to chart storytelling (24 hourly bars). Add boundary markers distinguishing gaps from bucket boundaries.
Tweak dataset so M4 visibly outperforms MinMax (late spike with pullback). Explain envelope, triangle method, and first/last advantage for users unfamiliar with downsampling.
Move gap-preserving LTTB right after LTTB. Add uniform (evenly spaced rows) and cadence (every Nth row with optional random offset) sections. Update syntax block and comparison table.
Add uniform (evenly spaced) and cadence (every Nth row) sections with SVG diagrams. Move gap-preserving LTTB under LTTB heading. Reorder MinMax before M4. Add relative cost row to comparison table.
Add uniform, cadence, and gap-preserving LTTB to the chart-ready examples section. Make DECLARE example demoable. Replace Grafana reference with generic programmatic integration.
Resolve conflict from deleted _cairo.config.json by adding cairo.sql.subsample.max.rows to cairo-engine.md in epigraph format.
Correct the source-row guarantee, designated timestamp requirement, output ordering, NULL handling, LTTB output count and gap allocation, M4 and MinMax gap and sizing claims, uniform and cadence edge cases, and the execution and memory model. Update cairo.sql.subsample.max.rows wording and mark the gap-detect diagram's line break as client-rendered.
Add the sdt(valueColumn, compdev) method: compression deviation tolerance, data-dependent output count, swinging-door mechanism, 2 * compdev reconstruction bound, NULL run boundaries, timestamp-gap behavior, query shape restrictions, and memory behavior. Add a static chart, a gap example chart, and the swinging-door animation. Show where SUBSAMPLE goes in a SELECT statement. State that cairo.sql.subsample.max.rows applies to lttb, m4, minmax, uniform, and cadence, and not to sdt.
Add a SUBSAMPLE window functions category to the window-function reference with cadence, lttb, m4, minmax, sdt, and uniform: signatures, the Boolean keep flag, argument validation, ordering, framing, partition, and NULL rules, and an outer-filter example each. Add a window-function form section to the SUBSAMPLE page explaining the two interfaces and when to use each. List the six functions in the window functions quick reference and correct the frame explanation. Rename the reference page's Examples section to Window function examples, keeping its anchor.
Add September 2026 changelog entries for the SUBSAMPLE page, the SUBSAMPLE window functions category, and cairo.sql.subsample.max.rows. Switch the outer-filter pattern to fx_trades with the demo column names and tag it as a demo query. Link the SUBSAMPLE page to the configuration reference instead of repeating the property's default, and link to the window functions section from See also.
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
SUBSAMPLEclause - time-series downsampling that selects real rows (no interpolation)fx_tradesdemo datasetcairo.sql.subsample.max.rowsto configuration referenceSUBSAMPLEto sidebar under SELECT, after SAMPLE BYscripts/gen_subsample_svgs.pyfor rebuilding diagramsDependencies