AUTOMATIC_CLUSTERING_HISTORY

functionsupportedTables, views, streams, sequences

docs.snowflake.com ↗

Information SchemaTable functions

This table function is used for querying the Automatic Clustering history for given tables within a specified date range. The information returned by the function includes the credits consumed, bytes updated, and rows updated each time a table is reclustered. Note This function does not include Optima Clustering data and is deprecated in favor of the ACCOUNT_USAGE.AUTOMATIC_CLUSTERING_HISTORY view, which provides a more complete data set and supports longer date ranges.

Syntax

supportedpartialnot supportednot scored

AUTOMATIC_CLUSTERING_HISTORY(
      [ DATE_RANGE_START => <constant_expr> ]
      [ , DATE_RANGE_END => <constant_expr> ]
      [ , TABLE_NAME => '<string>' ] )

Parameters

NameRequiredDescription
DATE_RANGE_START => constant_expr , DATE_RANGE_END => constant_exprrequiredThe date/time range to display the Automatic Clustering history. For example, if you specify that the start date is 2019-04-03 and the end date is 2019-04-05, then you get data for April 3, April 4, and April 5. (The endpoints are included.) If neither a start date nor an end date is specified, the default is the last 12 hours. If an end date is not specified, but a start date is specified, then CURRENT_DATE at midnight is used as the end of the range. If a start date is not specified, but an end date is specified, then the range starts 12 hours prior to the start of DATE_RANGE_END.
TABLE_NAME => stringrequiredTable name. If specified, only shows the history for the specified table. The table name can include the schema name and the database name. If a table name is not specified, then the results include history for each table maintained by the Automatic Clustering Service within the specified time range.

Usage notes

Output

The function returns the following columns: Column Name | Data Type | Description START_TIME | TIMESTAMP_LTZ | Start of the specified time range. END_TIME | TIMESTAMP_LTZ | End of the specified time range. TABLE_NAME | TEXT | Name of the table. Displays NULL if no table name is specified in the function, in which case each row includes the totals for all tables in use within the time range. CREDITS_USED | NUMBER | Number of credits billed for automatic clustering during the START_TIME and END_TIME window. NUM_BYTES_RECLUSTERED | NUMBER | Number of bytes reclustered during the START_TIME and END_TIME window. NUM_ROWS_RECLUSTERED | NUMBER | Number of rows reclustered during the START_TIME and END_TIME window.