Skip to content

num_live_ranges()

Count the number of live ranges

Since 1.16.0

Return the number of live periods from a heartbeat aggregate.

Given a table called liveness containing weekly heartbeat aggregates in column health with timestamp column date, use this query to see how many intervals the system was up in a given week:

SELECT num_live_ranges(health)
FROM liveness
WHERE date = '01-9-2022 UTC'

Returns:

num_live_ranges
---------
5

The syntax is:

num_live_ranges(
agg HEARTBEATAGG
) RETURNS BIGINT
NameTypeDefaultRequiredDescription
aggHeartbeatAgg-A heartbeat aggregate to get the number of ranges from
ColumnTypeDescription
num_live_rangesbigintThe number of live ranges in the aggregate.