REST API reference for the Query Analyzer static and runtime analysis endpoints.
Beta feature — Query Analyzer is disabled by default and available on demand. Contact your StarTree account team to have it enabled for your environment.
Query Analyzer exposes two REST endpoints on the StarTree Cloud data-manager service. Both return the same unified response structure.
{ "querySummary": "Counts all orders with status 'shipped' after a given Unix timestamp.", "analysisType": "STATIC", "findings": [ { "type": "MISSING_INVERTED_INDEX", "severity": "HIGH", "description": "Column 'status' is used in an equality predicate but has no inverted index. Every segment will be fully scanned.", "evidence": [ { "type": "MISSING_INDEX", "detail": "status: no inverted index found" } ], "confidence": "HIGH" } ], "recommendations": [ { "rank": 1, "title": "Add inverted index on 'status'", "type": "ADD_INVERTED_INDEX", "description": "An inverted index on 'status' will allow Pinot to skip segments that do not contain the predicate value, eliminating the full scan.", "suggestedChange": { "before": "\"invertedIndexColumns\": []", "after": "\"invertedIndexColumns\": [\"status\"]" }, "expectedImpact": "HIGH", "confidence": "HIGH", "tradeoffs": "Adds a small amount of index storage per segment. Requires a segment reload to take effect on existing data." } ]}
POST /api/data/manager/api/query-analyzer/runtime-analysis
Executes the query against your Pinot cluster using the multi-stage engine (MSE), collects stage execution statistics, then produces evidence-backed findings tied to measured operator metrics.If the query is not MSE-compatible, the service automatically falls back to static analysis. The response analysisType field reflects which mode was used, and mseIncompatibleReason is populated on fallback.
{ "sql": "SELECT status, COUNT(*) FROM orders WHERE ts BETWEEN 1700000000 AND 1710000000 GROUP BY status", "timeout": "PT120S"}
Field
Type
Required
Description
sql
string
Yes
The SQL query to execute and analyze
timeout
string
No
ISO-8601 duration override for the LLM call. Min: 10s. Max: 10 minutes.
Runtime analysis executes your query against the cluster. For very large or expensive queries, run static analysis first to catch structural issues before spending compute.
{ "querySummary": "Counts orders grouped by status within a time window.", "analysisType": "RUNTIME", "findings": [ { "type": "MISSING_RANGE_INDEX", "severity": "HIGH", "description": "Column 'ts' is used in a BETWEEN predicate but has no range index. All segments are being scanned.", "evidence": [ { "type": "MISSING_INDEX", "detail": "ts: no range index found" }, { "type": "HIGH_POST_FILTER_SCAN", "detail": "numEntriesScannedPostFilter: 48,200,000" } ], "confidence": "HIGH", "operator": "TABLE_SCAN", "metrics": { "executionTimeMs": 3420, "memoryAllocatedBytes": 0, "rowsProduced": 12400 } } ], "recommendations": [ { "rank": 1, "title": "Add range index on 'ts'", "type": "ADD_RANGE_INDEX", "description": "A range index on 'ts' allows Pinot to prune segments outside the time window, reducing the scan to only matching segments.", "suggestedChange": { "before": "\"rangeIndexColumns\": []", "after": "\"rangeIndexColumns\": [\"ts\"]" }, "expectedImpact": "HIGH", "confidence": "HIGH", "tradeoffs": "Adds index storage per segment. Requires a segment reload to take effect on existing data." } ]}