Skip to content

docs: document the optional count in SAMPLE BY - #530

Merged
tris0laris merged 1 commit into
mainfrom
jv/sample_by_bare_unit
Aug 28, 2026
Merged

docs: document the optional count in SAMPLE BY#530
tris0laris merged 1 commit into
mainfrom
jv/sample_by_bare_unit

Conversation

@javier

@javier javier commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

SAMPLE BY accepts a bare unit, where the count defaults to 1, so SAMPLE BY h and SAMPLE BY 1h are the same query. That has never been documented. Prompted by questdb/questdb#7391, which fixed w as the last unit that did not accept the bare form.

The syntax now reads SAMPLE BY [count]unit, with the default spelled out, plus the two constraints worth knowing: the count must be a positive integer, and no space is allowed before the unit.

Also renames the syntax placeholder. It was n, which is the nanosecond unit listed in the table immediately below, and making the count optional would have made that collision easier to trip over.

Verified against a local instance: all ten units accept the bare form and return result sets identical to the explicit 1<unit> form.

SAMPLE BY accepts a bare unit, where the count defaults to 1, but this was never written down. Also renames the syntax placeholder, which used n, the same letter as the nanosecond unit listed right below it.
@github-actions

Copy link
Copy Markdown

🚀 Build success!

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

Commit SHA: 5aebf2c

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

@tris0laris
tris0laris merged commit 97cc3ac into main Aug 28, 2026
3 checks passed
@tris0laris
tris0laris deleted the jv/sample_by_bare_unit branch August 28, 2026 10:40
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