WAREHOUSE_EVENTS_HISTORY view (ACCOUNT_USAGE): New columns and changes to events (Pending)

Attention

This behavior change is in the 2024_04 bundle.

For the current status of the bundle, refer to Bundle History.

When this behavior change bundle is enabled, the Account Usage WAREHOUSE_EVENTS_HISTORY View changes as follows.

New columns

The following new columns are added to the view:

Column Name

Data Type

Description

SIZE

VARCHAR

Current size of the warehouse at the time of the event. This value is only available for WAREHOUSE_CONSISTENT events. Otherwise, this value is NULL.

CLUSTER_COUNT

NUMBER

Number of warehouse clusters at the time of the event. This value is only available for WAREHOUSE_CONSISTENT events. Otherwise, this value is NULL.

These columns are added as the last (right-most) columns in the view.

New event: WAREHOUSE_CONSISTENT

Events that create a warehouse, change the size of the warehouse or the number of clusters, or suspend a warehouse, are not atomic operations. This means that some small amount of time is required for these operations to fully complete.

For example, if a warehouse is suspended using an ALTER WAREHOUSE … SUSPEND statement, any queries that are currently executing on the warehouse must complete (or time out) before it can be suspended. In some cases, multiple warehouse events might be in-flight (for example, resize and suspend). When all warehouse events have completed, the warehouse is in a consistent state.

EVENT_NAME

Description

WAREHOUSE_CONSISTENT

This state is reached when any pending changes to a warehouse are completed.

Changes to events

When this behavior change bundle is enabled, the event state PARTIALLY_COMPLETED is obsoleted.

If an event is logged with the STARTED state, it is never logged with the COMPLETED state. Instead, an event logged with the STARTED state is always followed by a subsequent WAREHOUSE_CONSISTENT event. If multiple warehouse events are logged with the STARTED event state, those events coalesce to the same WAREHOUSE_CONSISTENT event.

If an event is logged with the COMPLETED state, no subsequent WAREHOUSE_CONSISTENT event follows unless another pending event is logged with a STARTED state.

For example, an ALTER statement is logged with the COMPLETED state when there are no additional changes pending:

ALTER WAREHOUSE my_wh SET
  COMMENT = 'Updated comment for warehouse';
Copy

This statement results in the following row in the WAREHOUSE_EVENTS_HISTORY view:

TIMESTAMP

WAREHOUSE_NAME

EVENT_NAME

EVENT_STATE

SIZE

CLUSTER_COUNT

2024-04-26 16:42:13.513 +0000

MY_WH

ALTER_WAREHOUSE

COMPLETED

NULL

NULL

When an ALTER statement changes the warehouse size, a resize warehouse event follows:

ALTER WAREHOUSE my_wh SET
  WAREHOUSE_SIZE = 'SMALL';
Copy

This statement results in the following rows in the WAREHOUSE_EVENTS_HISTORY view:

TIMESTAMP

WAREHOUSE_NAME

EVENT_NAME

EVENT_STATE

SIZE

CLUSTER_COUNT

2024-04-26 16:42:35.694 +0000

MY_WH

ALTER_WAREHOUSE

STARTED

NULL

NULL

2024-04-26 16:42:35.694 +0000

MY_WH

RESIZE_WAREHOUSE

STARTED

NULL

NULL

2024-04-26 16:42:35.773 +0000

MY_WH

WAREHOUSE_CONSISTENT

COMPLETED

SMALL

1

Note that the WAREHOUSE_CONSISTENT event might share the same timestamp with another warehouse event and be listed out of order.

The possible values for the EVENT_STATE column for warehouse events changes as follows:

EVENT_NAME

EVENT_STATE before the change

EVENT_STATE after the change

CREATE_WAREHOUSE

COMPLETED

COMPLETED if no further changes are pending, otherwise STARTED.

In most cases, followed by a RESUME_WAREHOUSE event.

DROP_WAREHOUSE

COMPLETED

COMPLETED if no further changes are pending, otherwise STARTED.

In most cases, followed by a SUSPEND_WAREHOUSE event.

ALTER_WAREHOUSE

COMPLETED

COMPLETED if no further changes are pending, otherwise STARTED if the ALTER statement results in an eventually consistent event to follow.

RESIZE_WAREHOUSE

STARTED, . COMPLETED, . PARTIALLY_COMPLETED

STARTED

RESUME_WAREHOUSE

STARTED, . COMPLETED, . PARTIALLY_COMPLETED

STARTED

SUSPEND_WAREHOUSE

STARTED, . COMPLETED, . PARTIALLY_COMPLETED

STARTED

RESUME_CLUSTER

COMPLETED

STARTED

SUSPEND_CLUSTER

COMPLETED

STARTED

RESIZE_CLUSTER

COMPLETED

STARTED

SPINUP_CLUSTER

STARTED, . COMPLETED, . PARTIALLY_COMPLETED

STARTED

SPINDOWN_CLUSTER

STARTED, . COMPLETED, . PARTIALLY_COMPLETED

STARTED

Ref: 1616