<budget_name>!GET_MEASUREMENT_TABLE

View the credit usage data collected by the budget maintenance task. For more information, see Understand budget costs.

Syntax

<budget_name>!GET_MEASUREMENT_TABLE()
Copy

Access control requirements

  • The following minimum privileges and roles are required to view results for custom budgets:

  • The following role is required to view results for the account budget:

    Any application role for the account budget.

For more information, see Budgets roles and privileges.

Returns

The function returns the following columns:

Column Name

Data Type

Description

MEASUREMENT_TIME

NUMBER

UTC timestamp when the measurement was taken.

SERVICE_TYPE

VARCHAR

Type of service that is consuming credits, which can be one of the following:

  • AUTO_CLUSTERING

  • HYBRID_TABLE_REQUESTS

  • MATERIALIZED_VIEW

  • PIPE

  • QUERY_ACCELERATION

  • SEARCH_OPTIMIZATION

  • SERVERLESS_ALERTS

  • SERVERLESS_TASK

  • SNOWPIPE_STREAMING

  • WAREHOUSE_METERING

  • WAREHOUSE_METERING_READER

CREDITS_SPENT

NUMBER

Number of credits spent.

UPDATED_TIME

NUMBER

UTC timestamp when the measurement was updated.

Usage notes

Calling this method does not return the object. Because of this, you can’t use method chaining to call another method on the return value of this method. Instead, call each method in a separate SQL statement.

Examples

View the credit usage data collected for budget my_budget in schema budget_db.budget_schema:

CALL budget_db.budget_schema.my_budget!GET_MEASUREMENT_TABLE();
Copy

View the credit usage data collected for the account budget:

CALL snowflake.local.account_root_budget!GET_MEASUREMENT_TABLE();
Copy