REPLICATION_GROUP_LAG_HISTORY

functionpartialReplication, failover & backupBusiness Critical+

docs.snowflake.com ↗

Table functions

Returns the replication lag history for a secondary failover group over a time window. The results show how the replication lag for the group changed over time, returned as a step function that you can plot. The lag at a point in time is the difference between that time and the primary snapshot timestamp of the most recent completed refresh. Between refreshes, the lag increases as time passes. When a refresh completes, the lag drops because a newer snapshot becomes available. By default (when no date-range arguments are provided), the function returns data for the last 24 hours. Database and share replication are available to all accounts. Replication of other account objects & failover/failback require Business Critical Edition (or higher). To inquire about upgrading, please contact Snowflake Support.

Syntax

supportedpartialnot supportednot scored

REPLICATION_GROUP_LAG_HISTORY(
      REPLICATION_GROUP_NAME => '<string>'
      [ , START_TIME => <constant_expr> ]
      [ , END_TIME => <constant_expr> ] )

Parameters

NameRequiredDescription
REPLICATION_GROUP_NAME => 'string'requiredName of the secondary failover group to report on. The value must be a non-NULL constant and enclosed in single quotes. This argument is required.
START_TIME => constant_expr , END_TIME => constant_exprrequiredThe TIMESTAMP_LTZ time window (inclusive) for which to return the lag history: If neither START_TIME nor END_TIME is specified, the default is the last 24 hours. If START_TIME is omitted, it defaults to 24 hours before the current timestamp. If END_TIME is omitted, it defaults to the current timestamp. Both arguments must be constant values.

Usage notes

Output

The function returns the following columns: Column Name | Data Type | Description TIMESTAMP | TIMESTAMP_LTZ | Point in time for the lag measurement. LAG_SECONDS | NUMBER | Replication lag, in seconds, at that timestamp. This is the difference between TIMESTAMP and PRIMARY_SNAPSHOT_TIMESTAMP. PRIMARY_SNAPSHOT_TIMESTAMP | TIMESTAMP_LTZ | Primary snapshot timestamp from the most recent completed refresh in effect at that timestamp.

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.

See also