Showing results for 
Search instead for 
Did you mean: 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
Showing results for 
Search instead for 
Did you mean: 

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

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 ?


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.


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 ?

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.



Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!