Estimate costs for a connection
Stay organized with collections
Save and categorize content based on your preferences.
Version 4.0.25.14 (latest)
Connection cost estimating
Assign a sql
statement to the body of the request. e.g., for Ruby, {sql: 'select * from users'}
Note: If the connection's dialect has no support for cost estimates, an error will be returned
Request
POST
/connections/{connection_name}/cost_estimate
Expand HTTP Path definition...
connection_name
string
Name of connection
Expand HTTP Body definition...
body
SQL statement to estimate
Expand CreateCostEstimate definition...
sql
lock
string
SQL statement to estimate
Expand HTTP Query definition...
fields
string
Requested fields.
Response
200: Connection cost estimates
cost
lock
integer
Cost of SQL statement
cache_hit
lock
boolean
Does the result come from the cache?
cost_unit
lock
string
Cost measurement size
message
lock
string
Human-friendly message
400: Bad Request
message
lock
string
Error details
documentation_url
lock
string
Documentation link
404: Not Found
message
lock
string
Error details
documentation_url
lock
string
Documentation link
422: Validation Error
message
lock
string
Error details
Expand ValidationErrorDetail definition...
field
lock
string
Field with error
code
lock
string
Error code
message
lock
string
Error info message
documentation_url
lock
string
Documentation link
documentation_url
lock
string
Documentation link
429: Too Many Requests
message
lock
string
Error details
documentation_url
lock
string
Documentation link
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# Estimate costs for a connection\n\nVersion 4.0.25.14 (latest)\n\n### Connection cost estimating\n\nAssign a `sql` statement to the body of the request. e.g., for Ruby, `{sql: 'select * from users'}`\n\n**Note**: If the connection's dialect has no support for cost estimates, an error will be returned\n\nRequest\n-------\n\nPOST /connections/{connection_name}/cost_estimate \nDatatype \nDescription \nRequest \nHTTP Request \npath \nHTTP Path \nExpand HTTP Path definition... \nconnection_name \nstring \nName of connection \nbody \nHTTP Body \nExpand HTTP Body definition... \nbody \n[CreateCostEstimate](/looker/docs/reference/looker-api/latest/types/CreateCostEstimate) \nSQL statement to estimate\nExpand CreateCostEstimate definition... \nsql \n*lock* \nstring \nSQL statement to estimate \nquery \nHTTP Query \nExpand HTTP Query definition... \nfields \nstring \nRequested fields.\n\nResponse\n--------\n\n### 200: Connection cost estimates\n\nDatatype \nDescription \n(object) \n[CostEstimate](/looker/docs/reference/looker-api/latest/types/CostEstimate) \ncost \n*lock* \ninteger \nCost of SQL statement \ncache_hit \n*lock* \nboolean \nDoes the result come from the cache? \ncost_unit \n*lock* \nstring \nCost measurement size \nmessage \n*lock* \nstring \nHuman-friendly message\n\n### 400: Bad Request\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 404: Not Found\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 422: Validation Error\n\nDatatype \nDescription \n(object) \n[ValidationError](/looker/docs/reference/looker-api/latest/types/ValidationError) \nmessage \n*lock* \nstring \nError details \nerrors \n[ValidationErrorDetail](/looker/docs/reference/looker-api/latest/types/ValidationErrorDetail)\\[\\] \nExpand ValidationErrorDetail definition... \nfield \n*lock* \nstring \nField with error \ncode \n*lock* \nstring \nError code \nmessage \n*lock* \nstring \nError info message \ndocumentation_url \n*lock* \nstring \nDocumentation link \ndocumentation_url \n*lock* \nstring \nDocumentation link\n\n### 429: Too Many Requests\n\nDatatype \nDescription \n(object) \n[Error](/looker/docs/reference/looker-api/latest/types/Error) \nmessage \n*lock* \nstring \nError details \ndocumentation_url \n*lock* \nstring \nDocumentation link"]]