Schema:

ACCOUNT_USAGE

CORTEX_SEARCH_BATCH_QUERY_USAGE_HISTORY view

This Account Usage view can be used to query the usage history of Cortex Search batch search queries. Batch search queries incur three types of cost:

  • Serving cost: Charged based on the search index data size and the duration of the batch search query.
  • Query embedding cost: Charged based on the number of tokens embedded from the input workload. Standard embedding costs apply.
  • Virtual warehouse compute cost: Charged for the virtual warehouse used to run the batch search query. This cost isn’t included in this view.

This view tracks serving cost and query embedding cost only. It includes the credits consumed, billable indexed data, billable duration, and token usage for each batch search query submitted to a Cortex Search Service. For more information, see Cost considerations.

Columns

Column NameData TypeDescription
START_TIMETIMESTAMP_TZStart of the specified time range in which the Cortex Search batch search query usage took place.
END_TIMETIMESTAMP_TZEnd of the specified time range in which the Cortex Search batch search query usage took place.
QUERY_IDVARCHARInternal/system-generated identifier for the SQL statement that invoked the batch search query.
DATABASE_NAMEVARCHARName of the database in which the Cortex Search Service resides.
DATABASE_IDNUMBERInternal/system-generated identifier for the database in which the Cortex Search Service resides.
SCHEMA_NAMEVARCHARName of the schema in which the Cortex Search Service resides.
SCHEMA_IDNUMBERInternal/system-generated identifier for the schema in which the Cortex Search Service resides.
SERVICE_NAMEVARCHARName of the Cortex Search Service.
SERVICE_IDNUMBERInternal/system-generated identifier for the Cortex Search Service.
CONSUMPTION_TYPEVARCHARThe category of consumption incurred for the batch search query. One of: “BATCH_SERVING” (serving cost based on indexed data size and query duration) or “BATCH_EMBED_TEXT_TOKENS” (query embedding cost based on input tokens).
CREDITS_USEDNUMBERNumber of credits consumed for the batch search query for the specified CONSUMPTION_TYPE.
BILLABLE_INDEXED_DATA_BYTESNUMBERFor CONSUMPTION_TYPE = “BATCH_SERVING”, the number of bytes of indexed data billed during the batch search query. NULL for other consumption types.
BILLABLE_DURATION_SECONDSNUMBERFor CONSUMPTION_TYPE = “BATCH_SERVING”, the duration in seconds billed for the batch search query. NULL for other consumption types.
MODEL_NAMEVARCHARFor CONSUMPTION_TYPE = “BATCH_EMBED_TEXT_TOKENS”, the name of the embedding model used to generate vector embeddings for the batch search query input. NULL for other consumption types.
TOKENSNUMBERFor CONSUMPTION_TYPE = “BATCH_EMBED_TEXT_TOKENS”, the number of input tokens consumed for query embedding. NULL for other consumption types.

Usage notes

  • The view provides up-to-date credit usage for an account within the last 365 days (1 year).
  • Each row represents a single batch search query identified by QUERY_ID.
  • Serving cost is incurred per gigabyte-hour of indexed data, metered by the billable duration of the batch search query.
  • Query embedding cost is incurred per input token. Unlike interactive search, query embedding for batch search queries is a billable cost.
  • For daily-level aggregated batch usage, you can also query the CORTEX_SEARCH_DAILY_USAGE_HISTORY view with CONSUMPTION_TYPE = 'BATCH'.