Schema:

DATA_SHARING_USAGE

PROVIDER_APPLICATION_DAILY_USAGE_HISTORY view

Use this view to analyze the daily credit and storage usage for each consumer account of your Snowflake Native App listings. The view returns a record for each consumer account that had credit or storage activity for a given date.

Columns

The following table provides definitions for the columns in this view:

PROVIDER_APPLICATION_DAILY_USAGE_HISTORY

FieldTypeDescription
CONSUMER_SNOWFLAKE_REGIONVARCHARSnowflake Region where the consumer account is located.
CONSUMER_ORGANIZATION_NAMEVARCHAROrganization name of the consumer account.
CONSUMER_ACCOUNT_LOCATORVARCHARAccount locator of the consumer account.
CONSUMER_ACCOUNT_NAMEVARCHARAccount name of the consumer account.
APPLICATION_NAME_HASHVARCHAR

A hash that uniquely identifies the application installation on the consumer account. This value matches the result of the SYSTEM$GET_HASH_FOR_APPLICATION function, which consumers can call to look up the hash for their installed application.

LISTING_GLOBAL_NAMEVARCHARGlobal name of the listing associated with the application.
USAGE_DATEDATEThe date the usage occurred.
CREDITS_USEDNUMBER

Daily total credits consumed by the Snowflake Native App in the consumer account.

CREDITS_USED_BREAKDOWNARRAY

An array of objects identifying the Snowflake service and credits consumed. See CREDITS_USED_BREAKDOWN array for formatting.

STORAGE_BYTESNUMBER

Daily average storage bytes used by the Snowflake Native App in the consumer account.

STORAGE_BYTES_BREAKDOWNARRAY

An array of objects identifying the type and number of storage bytes used. See STORAGE_BYTES_BREAKDOWN array for formatting.

Usage notes

  • Latency for the view may be up to 2 days.
  • The data is retained for 365 days (1 year).
  • The view only returns data for listings owned by the current account.

CREDITS_USED_BREAKDOWN array

The CREDITS_USED_BREAKDOWN array provides details about the services that consumed daily credits.

Example:

[
  {
    "Credits": 0.005840921,
    "ServiceType": "AUTO_CLUSTERING"
  },
  {
    "Credits": 0.115940725,
    "ServiceType": "SERVERLESS_TASK"
  }
]

The following table provides descriptions for the key-value pairs in the objects in the array.

FieldData typeDescription
CreditsDECIMALNumber of credits consumed by the service type specified by ServiceType on the usage date.
ServiceTypeVARCHAR

The service type, which can be one of the following values:

The following are used in the determination of credit consumption:

  • The credits used by objects in the Snowflake Native App. For example, auto-clustering on tables in the Snowflake Native App.
  • The credits used by the warehouses owned by the Snowflake Native App.
  • The credits used by the compute pools dedicated to the Snowflake Native App.

STORAGE_BYTES_BREAKDOWN array

The STORAGE_BYTES_BREAKDOWN array provides details about the storage types that consumed storage.

Example:

[
  {
    "Bytes": 34043221,
    "ServiceType": "DATABASE"
  },
  {
    "Bytes": 109779541,
    "ServiceType": "FAILSAFE"
  }
]

The following table provides descriptions for the key-value pairs in the objects in the array.

FieldData typeDescription
BytesINTEGERNumber of storage bytes used.
ServiceTypeVARCHAR

The storage type, which can be one of the following values:

Only data stored in the Snowflake Native App is used to determine storage byte consumption. External databases created by the Snowflake Native App are not included in the determination of this value.

Examples

Shows top applications by credit usage for the last month:

SELECT
  application_name_hash,
  consumer_account_name,
  consumer_organization_name,
  SUM(credits_used) AS total_credits
FROM snowflake.data_sharing_usage.provider_application_daily_usage_history
WHERE usage_date >= DATEADD(month, -1, CURRENT_DATE())
GROUP BY 1, 2, 3
ORDER BY total_credits DESC;

Shows credit and storage consumption per application with the number of distinct consumer accounts for the last month:

SELECT
  application_name_hash,
  SUM(credits_used)                        AS total_credits,
  SUM(storage_bytes)                       AS total_storage_bytes,
  COUNT(DISTINCT consumer_account_locator) AS unique_consumers
FROM snowflake.data_sharing_usage.provider_application_daily_usage_history
WHERE usage_date >= DATEADD(month, -1, CURRENT_DATE())
GROUP BY 1
ORDER BY total_credits DESC;