Configure SQL warehouses
This article explains how to configure and manage SQL warehouses using the Databricks SQL UI.
What is a SQL warehouse?
A SQL warehouse is a compute resource that lets you run SQL commands on data objects within Databricks SQL. Compute resources are infrastructure resources that provide processing capabilities in the cloud.
To navigate to the SQL warehouse dashboard, click SQL Warehouses in the sidebar. By default, warehouses are sorted by state (running warehouses first), then in alphabetical order.
To help you get started quickly, Databricks creates a small SQL warehouse called Starter Warehouse automatically. You can edit or delete this SQL warehouse.
Requirements
SQL warehouses have the following requirements:
To create a SQL warehouse you must be a workspace admin or a user with unrestricted cluster creation permissions.
To manage a SQL warehouse you must be a workspace admin or have the Can Manage permission on the SQL warehouse.
Before you can create a serverless SQL warehouse in a region that supports the feature, there may be required steps:
If your account needs updated terms of use, workspace admins are prompted in the Databricks SQL UI.
If your workspace has an AWS instance profile, it might need updates to the trust relationship, depending on how and when it was created.
For serverless SQL warehouses, you must not exceed your account’s serverless quota for each region. Serverless quotas are a safety measure for serverless compute. See Serverless quotas.
View SQL warehouses
To navigate to the SQL warehouse dashboard, click SQL Warehouses in the sidebar.
By default, warehouses are sorted by state (running warehouses first), then in alphabetical order.
To help you get started quickly, Databricks creates a SQL warehouse called Starter Warehouse automatically. This SQL warehouse is sized Small. You can edit or delete this SQL warehouse.
Create a SQL warehouse
You can create a SQL warehouse using the New SQL Warehouse page in the web UI or using the SQL Warehouse API.
To create a SQL warehouse with an API, see SQL Warehouses APIs 2.0.
You can create a SQL warehouse using the Create SQL Warehouse button in the web UI or using the SQL Warehouse API or Terraform. The default settings create an efficient and high-performing SQL warehouse, but you can override any settings to fit your workload needs.
To create a SQL warehouse using the web UI:
Click SQL Warehouses in the sidebar.
Click Create SQL Warehouse.
Enter a Name for the warehouse.
Accept the default warehouse settings or edit them.
Cluster Size represents the size of the driver node and number of worker nodes associated with the cluster. The default is X-Large. To reduce query latency, increase the size. See Availability zones (AZ).
Auto Stop determines whether the warehouse stops if it’s idle for the specified number of minutes. Idle SQL warehouses continue to accumulate DBU and cloud instance charges until they are stopped.
Pro and classic SQL warehouses: The default is 45 minutes, which is recommended for typical use. The minimum is 10 minutes.
Serverless SQL warehouses: The default is 10 minutes, which is recommended for typical use. The minimum is 5 minutes when you use the UI. Note that you can create a serverless SQL warehouse using the SQL warehouses API, in which case you can set the Auto Stop value as low as 1 minute.
Scaling sets the minimum and maximum number of clusters that will be used for a query. The default is a minimum and a maximum of one cluster. You can increase the maximum clusters if you want to handle more concurrent users for a given query. Databricks recommends a cluster for every 10 concurrent queries. For more information, see Queueing and autoscaling.
In order to maintain optimal performance, Databricks periodically recycles clusters. During a recycle period, you may temporarily see a cluster count that exceeds the maximum as Databricks transitions new workloads to the new cluster and waits to recycle the old cluster until all open workloads have completed.
Type determines the type of warehouse. See What are the available warehouse types? for the list. See What are the warehouse type defaults? for the defaults.
(Optional) Configure advanced options. See Advanced options.
Click Create.
You can then configure warehouse permissions if you’d like.
Your SQL warehouse is now created and started. You can also create a SQL warehouse with Terraform using the databricks_sql_endpoint.
Advanced options
You can configure the following advanced options by expanding the Advanced options area when you create a new SQL warehouse or edit an existing SQL warehouse. You can also configure these options using the SQL Warehouses APIs 2.0.
Tags: Tags allow you to easily monitor the cost of cloud resources used by users and groups in your organization. You specify tags as key-value pairs.
Unity Catalog: If Unity Catalog is enabled for the workspace, it is the default for all new warehouses in the workspace. If Unity Catalog is not enabled for your workspace, you do not see this option. For more information about Unity Catalog, see Unity Catalog.
Channel: Use the Preview channel to test upcoming features. The preview version lets you try out functionality before it becomes the Databricks SQL standard. You can use it to test your queries and dashboards against upcoming changes.
Use the release notes to learn what’s in the latest preview version.
Important
Databricks recommends against using a preview version for production workloads. Because only admins can view a warehouse’s properties, including its channel, consider indicating that an SQL warehouse uses a preview version in the warehouse’s name so that users do not inadvertently use it for production workloads.
Start a warehouse
To manually start a SQL warehouse, click SQL Warehouses in the sidebar then click Start next to the warehouse.
If a SQL warehouse is stopped and you attempt to run a job or query that uses it, Databricks starts the warehouse automatically. A warehouse also restarts automatically if you open a query in the SQL editor that is saved to a stopped warehouse or if you open a dashboard that is saved with a dashboard-level warehouse assigned to it. Auto-restart works for all types of SQL warehouses, including serverless SQL warehouses, which start very quickly.
Manage SQL warehouses
You can choose to manage a SQL warehouses using the web UI or the SQL Warehouse API.
To stop a running warehouse, click Stop in the Actions column.
To start a stopped warehouse, click Start in the Actions column.
To delete a warehouse, click the kebab menu
, then click Delete.
To edit a warehouse, click the kebab menu
then click Edit.
To add and edit permissions, click the kebab menu
then click Permissions. To learn about permission levels, see SQL warehouse access control.
Upgrade a pro or classic SQL warehouse to a serverless SQL warehouse
To learn about serverless SQL warehouse, see Serverless compute. The serverless SQL warehouse option is available only if it has been enabled for the workspace. For accounts created before October 1, 2022, an account admin may need to accept terms. Your workspace’s instance profile must have the trust relationship and the workspace must satisfy the requirements.
Click SQL Warehouses in the sidebar.
In the Actions column, click the vertical ellipsis
then click Upgrade to Serverless.
Monitor a SQL warehouse
To monitor a SQL warehouse, click the name of a SQL warehouse and then the Monitoring tab. On the Monitoring tab, you see the following monitoring elements:
Live statistics: Live statistics show the currently running and queued queries, active SQL sessions, the warehouse status, and the current cluster count.
Time scale filter: The monitoring time scale filter sets the time range for the query count chart, running cluster chart, and the query history and event log table. The default time range is 8 hours, but you can specify 24 hours, 7 days, or 14 days. You can also click and drag on the bar chart to change the time range.
Query count chart: The query count chart shows the number of queries running or queued on the warehouse during the selected time frame.
Running clusters chart: The running clusters chart shows the number of clusters allocated to the warehouse during the selected time frame. During a cluster recycle, this count may temporarily exceed configured maximum.
Query history table: The query history table shows all of the queries active during the selected time frame, their start time and duration, and the user that executed the query. You can filter the queries by user, query duration, query status, and query type.

Note
The Cluster Count can be greater than one only if scaling is enabled and configured.
Cluster size
The table in this section maps SQL warehouse cluster sizes to Databricks cluster driver size and worker counts. The driver size only applies to pro and classic SQL warehouses.
Note
For serverless SQL warehouses, the cluster sizes may in some cases use different instance types than the ones listed in the documentation for pro and classic SQL warehouses for an equivalent cluster size. In general, the price/performance ratio of the cluster sizes for serverless SQL warehouses is similar to those for pro and classic SQL warehouses.
Cluster size |
Instance type for driver (applies only to pro and classic SQL warehouses) |
Worker count |
---|---|---|
2X-Small |
i3.2xlarge |
1 x i3.2xlarge |
X-Small |
i3.2xlarge |
2 x i3.2xlarge |
Small |
i3.4xlarge |
4 x i3.2xlarge |
Medium |
i3.8xlarge |
8 x i3.2xlarge |
Large |
i3.8xlarge |
16 x i3.2xlarge |
X-Large |
i3.16xlarge |
32 x i3.2xlarge |
2X-Large |
i3.16xlarge |
64 x i3.2xlarge |
3X-Large |
i3.16xlarge |
128 x i3.2xlarge |
4X-Large |
i3.16xlarge |
256 x i3.2xlarge |
The instance size of all workers is i3.2xlarge.
Availability zones (AZ)
For SQL warehouses, AWS availability zones are set to auto (Auto-AZ), where the AZ is automatically selected based on available IPs in the workspace subnets. Auto-AZ retries in other availability zones if AWS returns insufficient capacity errors. For more about availability zones, see the AWS documentation.
Queueing and autoscaling
Databricks limits the number of queries on a cluster assigned to a SQL warehouse based on the cost to compute their results. Upscaling of clusters per warehouse is based on query throughput, the rate of incoming queries, and the queue size.
Databricks adds clusters based on the time it would take to process all currently running queries, all queued queries, and the incoming queries expected in the next two minutes.
If less than 2 minutes, don’t upscale.
If 2 to 6 minutes, add 1 cluster.
If 6 to 12 minutes, add 2 clusters.
If 12 to 22 minutes, add 3 clusters.
Otherwise, Databricks adds 3 clusters plus 1 cluster for every additional 15 minutes of expected query load.
In addition, a warehouse is always upscaled if a query waits for 5 minutes in the queue.
If the load is low for 15 minutes, Databricks downscales the SQL warehouse. It keeps enough clusters to handle the peak load over the last 15 minutes. For example, if the peak load was 25 concurrent queries, Databricks keeps 3 clusters.
Query queuing
Databricks queues queries when all clusters assigned to the warehouse are executing queries at full capacity or when the warehouse is in the STARTING
state.
Metadata queries (for example, DESCRIBE <table>
) and state modifying queries (for example SET
) are never queued, unless the warehouse is in the STARTING
state.