Warehouses system table reference
Preview
This system table is in Public Preview. To access the table, the schema must be enabled in your system
catalog. For more information, see Enable system table schemas.
In this article, you learn how to use the warehouses system table to monitor and manage the SQL warehouses in your workspaces. Each row is a snapshot of the SQL warehouse properties at that moment. A new snapshot is created when the properties change.
The warehouses system table is located at system.compute.warehouses
.
Warehouses table schema
Column name |
Data type |
Description |
Example |
---|---|---|---|
|
string |
The ID of the SQL warehouse. |
|
|
string |
The ID of the workspace where the warehouse is deployed. |
|
|
string |
The ID of the Databricks account. |
|
|
string |
The name of the SQL warehouse. |
|
|
string |
The type of SQL warehouse. Possible values are |
|
|
string |
The channel of the SQL warehouse. Possible values are |
|
|
string |
The cluster size of the SQL warehouse. Possible values are |
|
|
int |
The minimum number of clusters permitted. |
|
|
int |
The maximum number of clusters permitted. |
|
|
int |
The number of minutes before the SQL warehouse auto-stops due to inactivity. |
|
|
map |
Tags for the SQL warehouse. |
|
|
timestamp |
Timestamp of change to the SQL warehouse definition. |
|
|
timestamp |
Timestamp of when the SQL warehouse was deleted. The value is |
|
Sample queries
The following sample queries are templates. Plug in whatever values make sense for your organization. You can also add alerts to these queries to help you stay informed about changes to your warehouses. See Create an alert.
Use the following sample queries to gain insight into warehouse behavior:
Identify the settings for all active warehouses
This query identifies the settings for all warehouses that are currently active.
USE CATALOG `system`;
SELECT
warehouse_id,
warehouse_name,
warehouse_type,
warehouse_channel,
warehouse_size,
min_clusters,
max_clusters,
auto_stop_minutes,
tags,
change_time,
delete_time
FROM
system.compute.warehouses
QUALIFY
ROW_NUMBER() OVER (PARTITION BY warehouse_id ORDER BY change_time DESC) = 1
and delete_time is null;
Which warehouses were created this week?
This query identifies the warehouses that were created in the last seven days.
SELECT
warehouse_id,
warehouse_name,
warehouse_type,
warehouse_channel,
warehouse_size,
min_clusters,
max_clusters,
auto_stop_minutes,
tags,
change_time as datetime_created,
delete_time
FROM
system.compute.warehouses
QUALIFY
ROW_NUMBER() OVER (PARTITION BY warehouse_id ORDER BY change_time ASC) = 1
and change_time >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL 7 days
and delete_time is null;