Versions:
into_values() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.ExperimentalExperimental features are not suitable for production environments. They are included under the TimescaleDB experimental schema. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Experimental
Experimental features are not suitable for production environments. They are included under the TimescaleDB experimental schema. Click to learn more.
Returns the data accumulated in a state aggregate.
into_values (
agg StateAgg
) RETURNS (TEXT, BIGINT)
warning
Experimental features could have bugs. They might not be backwards compatible, and could be removed in future releases. Use these features at your own risk, and do not use any experimental features in production.
Required arguments
Name | Type | Description |
---|---|---|
agg | StateAgg | The aggregate to display data for |
Returns
Column | Type | Description |
---|---|---|
state | TEXT | A state found in the StateAgg |
duration | BIGINT | The duration of time spent in that state |
Sample usage
Create a state aggregate from the table states_test
. The time column is named
time
, and the state
column contains text values corresponding to different
states of a system. Use into_values
to display the data from the state
aggregate:
SELECT state, duration FROM toolkit_experimental.into_values(
(SELECT toolkit_experimental.state_agg(time, state) FROM states_test));
Example output:
state | duration
------+-----------
ERROR | 3000000
OK | 106000000
START | 11000000
Found an issue on this page?
Report an issue!