cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Do we pay just for qurery run duration while using databricks serverless sql ?

RahulChaubey
New Contributor III

While using databricks serverless sql to run queries does we only pay for the compute resources during the run duration of the query ?

3 REPLIES 3

Kaniz
Community Manager
Community Manager

 

When using Databricks Serverless SQL, the pricing model is designed to be pay-as-you-go and is based on Databricks Units (DBUs).
 
Let me break it down for you:
  1. Serverless SQL allows you to run SQL queries for BI reporting, analytics, and visualization on your data lakes. It comes in two flavors: Classic and Serverless (managed) compute12.

  2. With Serverless SQL, you pay for the compute resources used during the query execution. Hereโ€™s how it works:

    • When you execute a query, Databricks provisions the necessary compute resources (DBUs) to process that query.
    • You are billed for the duration of the query execution, which includes the time it takes to process the query and return the results.
    • Once the query completes, the allocated compute resources are released, and you are no longer billed for them.
  3. The pricing is based on the number of DBUs consumed during query execution. The exact cost depends on factors like query complexity, data volume, and performance optimizations1.

  4. Additionally, Databricks offers a 14-day free trial for you to explore and evaluate the service. If you have specific requirements or need committed-use discounts, you can also contact Databricks1.

In summary, with Databricks Serverless SQL, you pay only for the compute resources used during the actual query execution, making it a flexible and cost-effective option for running SQL workloads at scale.

 

RahulChaubey
New Contributor III

If once the query completes, the allocated compute resources are released, and you are no longer billed for them. then what is the significance of auto stop mins for sql warehouses ?

artsheiko
Valued Contributor III
Valued Contributor III

Hi Rahul,

The first query sent to SQL Serverless Warehouse will face a cold start of 2-6 seconds. The second query, third etc queries will be executed without this delay.

The auto-stop configuration controls how much time the warehouse would remain in running state. Once auto-stop will initiate the termination action, the next query will again wait for 2-6 seconds to re-start the compute.

Also, while the warehouse remains alive, you benefit from an in-memory cache. This allows repetitive queries to be executed faster until the auto-termination period is over. If the warehouse is stopped, we lose the cache in question.

Let me know if it's clear.

Best,