SYSTEM$ESTIMATE_SEARCH_OPTIMIZATION_COSTS

functionsupportedTables, views, streams, sequencesEnterprise+

docs.snowflake.com ↗

System functions

Returns the estimated costs of adding search optimization to a given table and configuring specific columns for search optimization. Important Cost estimates returned by the SYSTEM$ESTIMATE_SEARCH_OPTIMIZATION_COSTS function are best efforts. The actual realized costs can vary by up to 50% (or, in rare cases, by several times) from the estimated costs. - Build and storage cost estimates are based on sampling a subset of the rows in the table - Maintenance cost estimates are based on recent create, delete, and update activity in the table

Syntax

supportedpartialnot supportednot scored

SYSTEM$ESTIMATE_SEARCH_OPTIMIZATION_COSTS('<table_name>' [ , '<search_method_with_target>' ])

Parameters

NameRequiredDescription
table_namerequiredTable for which you want to estimate the search optimization costs. If the table name is not fully-qualified (in the form of db_name.schema_name.table_name or schema_name.table_name), the function looks for the table in the current schema for the session. The entire name must be enclosed in single quotes.
search_method_with_targetoptionalSpecifies a search method and target for a column configuration similar to what can be specified in the ON clause of the ALTER TABLE … ADD SEARCH OPTIMIZATION command. This entire argument must be enclosed in single quotes. Within this string, use double quotes around column names where required.

Usage notes

Output

The function returns a JSON object with the properties described below: Property | Description tableName | Name of the table. searchOptimizationEnabled | true if search optimization is enabled for the table or any columns in it; false otherwise. costPositions | Array of objects that describe the predicted costs of adding search optimization to the table or its columns. Each object in the costPositions array represents a different type of cost estimate: The name property identifies the type of cost represented by the object. name can be one of the following: name of object in costPositions | Description BuildCosts | This object describes the predicted costs of building the search access path for the table. If search optimization has already been added to the table or to all the specified columns, this object contains no cost information. StorageCosts | This object describes the predicted amount of storage space (in TB) needed for the search access path for the table. Benefit | This object appears only when the table has search optimization enabled. It does not contain information at this time. MaintenanceCosts | This object describes the predicted costs of maintaining the search access path for the table when rows are inserted, deleted, or modified. If the table has been created recently, no cost information is reported. Each object in the costPositions array can have the following properties: Property | Description name | Name that identifies the type of cost information represented by this object. costs | Object that describes the predicted costs in terms of the following properties: value | Amount of the predicted cost. unit | Unit of measure for the cost (e.g., “Credits” for compute costs, “TB” for storage costs, etc.). perTimeUnit | For maintenance costs, the unit of time that the estimated cost covers (for example, "MONTH" for the cost per month). computationMethod | Method used to estimate the costs, if multiple methods are available. comment | Additional information about the estimated cost.