Setting 1-Minute SQL Warehouse Auto-termination via API in Databricks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2026 02:14 AM
Hi everyone,
I wanted to share a quick technical tip for those looking to optimize their SQL Warehouse configurations, especially when dealing with intermittent ad hoc queries or AI BI Dashboards.
The Challenge: When setting up a SQL Warehouse, the Databricks UI currently enforces a minimum auto-termination limit of 5 minutes. For scenarios where you only need to run 1–2 quick queries and then want the compute to spin down immediately, those extra 4 minutes of idle time can add up across multiple warehouses or workspaces.
The Workaround: While the UI has a 5-minute "hard" limit, the Databricks REST API provides more granular control. You can actually set the auto_stop_mins parameter to 1 minute by sending a request to the SQL Warehouses API.
This is particularly useful for:
- Ad hoc tasks: Reducing the "idle tail" after a developer finishes a session.
- Dashboards: Ensuring the warehouse shuts down quickly after a scheduled or manual refresh.
- Resource Management: Keeping your compute footprint as lean as possible without waiting for the UI-defined timeout.
I’ve put together a short guide on how to authenticate and execute this API call to bypass the UI restriction.
Check out the full walkthrough here: https://medium.com/@protmaks/databricks-sql-warehouse-auto-termination-1-minute-via-api-ebe85d775118
On Medium, anyone can share insightful perspectives, useful knowledge, and life wisdom with the world.
Labels: