Sub topic 1
What a SQL warehouse is and when to use one
Prerequisites
Assume you know basic SQL, including SELECT, WHERE, GROUP BY, and JOIN. You should also understand that catalogs, schemas, and tables hold data, while compute runs queries against that data.
What a SQL warehouse is and when to use one
A SQL warehouse is Databricks compute designed for SQL queries. It provides CPU, memory, and query execution services without requiring you to manage a general-purpose cluster.
Use a SQL warehouse for interactive analysis, reports, dashboards, scheduled SQL jobs, and applications that submit SQL statements. Use another compute type when you need custom Spark code, specialized libraries, or long-running data engineering workloads.
SELECT 1 AS warehouse_test;A warehouse can read governed data in Unity Catalog while applying permissions assigned to the user or group running the query.
Choosing between serverless, pro, and classic warehouses
The warehouse type affects startup time, management, and available features.
| Type | Best fit | Main trade-off |
|---|---|---|
| Serverless | Fast interactive queries with minimal administration | Availability and features depend on the workspace region and configuration |
| Pro | Workloads needing more control or advanced SQL capabilities | More configuration and administration |
| Classic | Organizations that need compute resources managed in their cloud account | More startup and infrastructure management |
Choose serverless for most interactive workloads when it is available. Choose pro or classic when a required feature, networking model, or organizational policy demands it.
Picking a warehouse size
Size controls the resources available to each warehouse cluster. Start small for light analysis. Increase the size when queries repeatedly spill, queue, or take too long. A larger warehouse can reduce runtime, but it costs more while running.
Autoscaling clusters and auto stop
Autoscaling adds or removes clusters as demand changes. It helps concurrent users without keeping the maximum capacity running all the time. Auto stop shuts down an idle warehouse after a configured period. A stopped warehouse may take time to start again, so balance responsiveness against cost.
Controlling who can use and manage a warehouse
Warehouse permissions usually separate using, monitoring, and managing. Grant CAN USE to people who should run queries, CAN MONITOR to operators who inspect activity, and CAN MANAGE only to administrators who need to change settings or permissions.
Exercise
Which warehouse choice is a reasonable starting point for interactive analysis when serverless is available?
Show answer
Start with a small serverless warehouse, enable auto stop, and increase capacity only when measured workload demand requires it.