SYSTEM$CLUSTERING_INFORMATION

functionsupportedTables, views, streams, sequences

docs.snowflake.com ↗

System functions

Returns clustering information, including average clustering depth and Automatic Clustering version, for a table based on one or more columns in the table.

Syntax

supportedpartialnot supportednot scored

SYSTEM$CLUSTERING_INFORMATION( '<table_name>'
    [ , { '( <expr1> [ , <expr2> ... ] )' | <number_of_errors> } ] )

Parameters

NameRequiredDescription
table_namerequiredTable for which you want to return clustering information.
(expr1 [ , expr2 ... ])requiredColumn names or expressions for which clustering information is returned: For a table with no clustering key, this argument is required. If this argument is omitted, an error is returned. For a table with a clustering key, this argument is optional; if the argument is omitted, Snowflake uses the defined clustering key to return clustering information. Even if only one column name or expression is passed, it must be inside parentheses. Note You can use this argument to return clustering information for any columns in the table, regardless of whether a clustering key is defined for the table. In other words, you can use this to help you decide what clustering to use in the future.
number_of_errorsrequiredNumber of clustering errors returned by the function. If this argument is omitted, the 10 most recent errors are returned.

Returns

The function returns a value of type VARCHAR. The returned string is in JSON format and contains the following name/value pairs: For more information about micro-partition overlap and depth, and their impact on query pruning, see Understanding Snowflake Table Structures.

Usage notes

Limitations

If a table has more than 2 million partitions: - The results of the function are based on a subset of the table’s partitions. - The value of the output’s total_partition_count field is 2 million.

See also

Referenced by