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 two 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.

The information in this view 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 Name

Data Type

Description

START_TIME

TIMESTAMP_TZ

Start of the specified time range in which the Cortex Search batch search query usage took place.

END_TIME

TIMESTAMP_TZ

End of the specified time range in which the Cortex Search batch search query usage took place.

QUERY_ID

VARCHAR

Internal/system-generated identifier for the SQL statement that invoked the batch search query.

DATABASE_NAME

VARCHAR

Name of the database in which the Cortex Search Service resides.

DATABASE_ID

NUMBER

Internal/system-generated identifier for the database in which the Cortex Search Service resides.

SCHEMA_NAME

VARCHAR

Name of the schema in which the Cortex Search Service resides.

SCHEMA_ID

NUMBER

Internal/system-generated identifier for the schema in which the Cortex Search Service resides.

SERVICE_NAME

VARCHAR

Name of the Cortex Search Service.

SERVICE_ID

NUMBER

Internal/system-generated identifier for the Cortex Search Service.

CONSUMPTION_TYPE

VARCHAR

The 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_USED

NUMBER

Number of credits consumed for the batch search query for the specified CONSUMPTION_TYPE.

BILLABLE_INDEXED_DATA_BYTES

NUMBER

For CONSUMPTION_TYPE = “BATCH_SERVING”, the number of bytes of indexed data billed during the batch search query. NULL for other consumption types.

BILLABLE_DURATION_SECONDS

NUMBER

For CONSUMPTION_TYPE = “BATCH_SERVING”, the duration in seconds billed for the batch search query. NULL for other consumption types.

MODEL_NAME

VARCHAR

For 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.

TOKENS

NUMBER

For 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'.