SYSTEM$CLUSTERING_DEPTH

functionsupportedTables, views, streams, sequences

docs.snowflake.com ↗

System functions

Computes the average depth of the table according to the specified columns (or the clustering key defined for the table). The average depth of a populated table (i.e. a table containing data) is always 1 or more. The smaller the average depth, the better clustered the table is with regards to the specified columns. For more information about micro-partitions and clustering keys, see Understanding Snowflake Table Structures.

Syntax

supportedpartialnot supportednot scored

SYSTEM$CLUSTERING_DEPTH( '<table_name>' , '( <col1> [ , <col2> ... ] )' [ , '<predicate>' ] )

Parameters

NameRequiredDescription
table_namerequiredTable for which you want to calculate the clustering depth.
col1 [ , col2 ... ]requiredColumn(s) in the table used to calculate the clustering depth: 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 calculate the depth. Note You can use this argument to calculate the depth for any columns in the table, regardless of the clustering key defined for the table.
predicaterequiredClause that filters the range of values in the columns on which to calculate the clustering depth. Note that predicate does not utilize a WHERE keyword at the beginning of the clause.

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.

See also

Referenced by