Skip to content

docs(sql): document percentile_cont and percentile_disc - #599

Merged
javier merged 2 commits into
mainfrom
nw_percentile_docs
Oct 23, 2026
Merged

javier merged 2 commits into
mainfrom
nw_percentile_docs

Conversation

@nwoolmer

Copy link
Copy Markdown
Contributor

Summary

Documents the exact percentile functions added in questdb/questdb#6680.

  • Aggregate functions: new percentile_cont / quantile_cont and percentile_disc / quantile_disc sections. They cover the single-percentile and DOUBLE[] multi-percentile forms, how each value is computed (SQL standard / PostgreSQL definitions), return types (percentile_disc returns LONG for integer input), NULL handling, and limitations (FILL(LINEAR), constant fill on the array form, memory use per group). Both are added to the Statistical aggregates table.
  • approx_percentile: documents the new DOUBLE[] form and links to the exact functions.
  • Window functions: new percentile_cont() / percentile_disc() reference section (whole-partition only, constant percentile, not in live views) and a quick-reference row on the overview.
  • Cookbook: the query times histogram now uses one percentile_disc call over a percentile array with UNNEST ... WITH ORDINALITY, replacing ten approx_percentile calls and ten UNION ALL branches, and adds a non-cumulative variant using lag().

All result tables and documented behaviors were checked against a build of QuestDB master.

Dependencies

🤖 Generated with Claude Code

nwoolmer and others added 2 commits October 22, 2026 18:53
Document the exact percentile functions added in questdb/questdb#6680:
percentile_cont and percentile_disc, their quantile_cont and
quantile_disc aliases, the DOUBLE[] multi-percentile form, and the
whole-partition window functions. Add the array form of
approx_percentile.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace ten approx_percentile calls and ten UNION ALL branches with one
percentile_disc call over an array of percentiles, expanded with
UNNEST WITH ORDINALITY. Add a non-cumulative variant using lag().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Build success!

Latest successful preview: https://preview-599--questdb-documentation.netlify.app/docs/

Commit SHA: b48196d

📦 Build generates a preview & updates the link on each commit.

@javier
javier merged commit f7c1626 into main Oct 23, 2026
3 checks passed
@javier
javier deleted the nw_percentile_docs branch October 23, 2026 11:51
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.

2 participants