Request
Make aGET
request to /cost
with a query
parameter:
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ | Raw SQL query to evaluate |
Response
Fields
Field | Type | Description |
---|---|---|
original_cost | number | Cost estimate of the unoptimized query (USD) |
optimized_cost | number | Cost estimate of the rewritten query (USD) |
savings | number | Difference between original and optimized cost |
Notes
- On BigQuery, this uses real dry-run estimates.
- On other engines, costs are approximated using:
- Column count
- Join complexity
- Filter selectivity
- Use this endpoint to evaluate query rewrites without executing them.
Next: Verify Result Equivalence
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
SQL query string