docs: document streaming EXPLAIN ANALYZE HTTP API - #2730
Open
discord9 wants to merge 1 commit into
Open
Conversation
Add the POST /v1/sql/analyze/stream (SSE) endpoint contract to the HTTP endpoint reference: request parameters, EXPLAIN ANALYZE VERBOSE statement restrictions, the metrics/final/canceled/error SSE events and payload fields, snapshot semantics (complete best-effort snapshot, adaptive coalescing), client-disconnect behavior, and the no resume/reconnect lifecycle. Synchronized to EN/ZH Nightly and v1.2. Signed-off-by: discord9 <discord9@163.com>
fengjiachun
reviewed
Aug 10, 2026
| ```bash | ||
| curl -N -X POST 'http://127.0.0.1:4000/v1/sql/analyze/stream' \ | ||
| -H 'Accept: text/event-stream' \ | ||
| -F 'sql=EXPLAIN ANALYZE VERBOSE SELECT * FROM monitor' |
Contributor
There was a problem hiding this comment.
The example uses curl -F, which sends multipart/form-data, but this handler extracts Axum Form<SqlQuery>, which accepts application/x-www-form-urlencoded. Because the unsupported media type is ignored and no query-string sql is supplied, this command reaches sql parameter is required instead of opening an SSE stream. Please use --data-urlencode 'sql=EXPLAIN ANALYZE VERBOSE SELECT * FROM monitor' and update all four copies so the documented example works.
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.
What changed
Document the
POST /v1/sql/analyze/stream(SSE) endpoint contract added in v1.2 (upstream GreptimeDB #8380): request parameters,EXPLAIN ANALYZE VERBOSEstatement restrictions, themetrics/final/canceled/errorSSE events and payload fields, snapshot semantics (complete best-effort snapshot with adaptive coalescing), client-disconnect cancellation, and the no resume/reconnect lifecycle.Closes #2719.
Scope
Verification
http.experimental_enable_explain_analyze_stream = true,snapshot_interval_msdefault 5000 clamped to [1000, 60000]).Checklist