---
title: About TimescaleDB hyperfunctions | Tiger Data Docs
description: Use hyperfunctions for enhanced real-time analytics
---

TimescaleDB hyperfunctions package common time-series analytics patterns (percentiles, counters, sessionization, approximate distincts) as composable SQL functions instead of hand-rolled window logic. They help across IoT, IT telemetry, product analytics, finance, and many other event-heavy domains. Hyperfunctions aim to keep those queries fast enough to feel real time.

Tiger Cloud includes all hyperfunctions by default, while self-hosted TimescaleDB includes a subset of them. For additional hyperfunctions, install the [TimescaleDB Toolkit](/docs/deploy/self-hosted/tooling/install-toolkit/index.md) PostgreSQL extension.

## Available hyperfunctions

Here is a list of all the hyperfunctions provided by TimescaleDB. Hyperfunctions with a tick in the `Toolkit` column require an installation of TimescaleDB Toolkit for self-hosted deployments. Hyperfunctions with a tick in the `Experimental` column are still under development.

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.

Tips

When you upgrade the `timescaledb` extension, the experimental schema is removed by default. To use experimental features after an upgrade, you need to add the experimental schema again.

### Approximate count distinct functions

| Type                | Name                                                                                                           | Toolkit | Experimental |
| ------------------- | -------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate           | [`hyperloglog()`](/docs/reference/toolkit/approximate-count-distinct/hyperloglog/index.md)                     | ✅       |              |
| Alternate aggregate | [`approx_count_distinct()`](/docs/reference/toolkit/approximate-count-distinct/approx_count_distinct/index.md) | ✅       |              |
| Accessor            | [`distinct_count()`](/docs/reference/toolkit/approximate-count-distinct/distinct_count/index.md)               | ✅       |              |
|                     | [`stderror()`](/docs/reference/toolkit/approximate-count-distinct/stderror/index.md)                           | ✅       |              |
| Rollup              | [`rollup()`](/docs/reference/toolkit/approximate-count-distinct/rollup/index.md)                               | ✅       |              |

### Counters and gauges functions

**`counter_agg()` functions**

| Type      | Name                                                                                                          | Toolkit | Experimental |
| --------- | ------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`counter_agg()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/counter_agg/index.md)               | ✅       |              |
| Accessor  | [`corr()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/corr/index.md)                             | ✅       |              |
|           | [`counter_zero_time()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/counter_zero_time/index.md)   | ✅       |              |
|           | [`delta()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/delta/index.md)                           | ✅       |              |
|           | [`extrapolated_delta()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/extrapolated_delta/index.md) | ✅       |              |
|           | [`extrapolated_rate()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/extrapolated_rate/index.md)   | ✅       |              |
|           | [`first_time()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/first_time/index.md)                 | ✅       |              |
|           | [`first_val()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/first_val/index.md)                   | ✅       |              |
|           | [`idelta_left()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/idelta_left/index.md)               | ✅       |              |
|           | [`idelta_right()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/idelta_right/index.md)             | ✅       |              |
|           | [`intercept()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/intercept/index.md)                   | ✅       |              |
|           | [`interpolated_delta()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/interpolated_delta/index.md) | ✅       |              |
|           | [`interpolated_rate()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/interpolated_rate/index.md)   | ✅       |              |
|           | [`irate_left()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/irate_left/index.md)                 | ✅       |              |
|           | [`irate_right()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/irate_right/index.md)               | ✅       |              |
|           | [`last_time()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/last_time/index.md)                   | ✅       |              |
|           | [`last_val()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/last_val/index.md)                     | ✅       |              |
|           | [`num_changes()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/num_changes/index.md)               | ✅       |              |
|           | [`num_elements()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/num_elements/index.md)             | ✅       |              |
|           | [`num_resets()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/num_resets/index.md)                 | ✅       |              |
|           | [`rate()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/rate/index.md)                             | ✅       |              |
|           | [`slope()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/slope/index.md)                           | ✅       |              |
|           | [`time_delta()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/time_delta/index.md)                 | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/rollup/index.md)                         | ✅       |              |
| Mutator   | [`with_bounds()`](/docs/reference/toolkit/counters-and-gauges/counter_agg/with_bounds/index.md)               | ✅       |              |

**`gauge_agg()` functions**

| Type      | Name                                                                                                        | Toolkit | Experimental |
| --------- | ----------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`gauge_agg()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/gauge_agg/index.md)                   | ✅       | ✅            |
| Accessor  | [`corr()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/corr/index.md)                             | ✅       | ✅            |
|           | [`delta()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/delta/index.md)                           | ✅       | ✅            |
|           | [`extrapolated_delta()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/extrapolated_delta/index.md) | ✅       | ✅            |
|           | [`extrapolated_rate()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/extrapolated_rate/index.md)   | ✅       | ✅            |
|           | [`gauge_zero_time()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/gauge_zero_time/index.md)       | ✅       | ✅            |
|           | [`idelta_left()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/idelta_left/index.md)               | ✅       | ✅            |
|           | [`idelta_right()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/idelta_right/index.md)             | ✅       | ✅            |
|           | [`intercept()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/intercept/index.md)                   | ✅       | ✅            |
|           | [`interpolated_delta()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/interpolated_delta/index.md) | ✅       | ✅            |
|           | [`interpolated_rate()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/interpolated_rate/index.md)   | ✅       | ✅            |
|           | [`irate_left()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/irate_left/index.md)                 | ✅       | ✅            |
|           | [`irate_right()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/irate_right/index.md)               | ✅       | ✅            |
|           | [`num_changes()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/num_changes/index.md)               | ✅       | ✅            |
|           | [`num_elements()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/num_elements/index.md)             | ✅       | ✅            |
|           | [`slope()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/slope/index.md)                           | ✅       | ✅            |
|           | [`rate()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/rate/index.md)                             | ✅       | ✅            |
|           | [`time_delta()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/time_delta/index.md)                 | ✅       | ✅            |
| Rollup    | [`rollup()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/rollup/index.md)                         | ✅       | ✅            |
| Mutator   | [`with_bounds()`](/docs/reference/toolkit/counters-and-gauges/gauge_agg/with_bounds/index.md)               | ✅       | ✅            |

### Downsampling functions

| Type     | Name                                                                         | Toolkit | Experimental |
| -------- | ---------------------------------------------------------------------------- | ------- | ------------ |
| Function | [`asap_smooth()`](/docs/reference/toolkit/downsampling/asap_smooth/index.md) | ✅       |              |
|          | [`lttb()`](/docs/reference/toolkit/downsampling/lttb/index.md)               | ✅       |              |
|          | [`gp_lttb()`](/docs/reference/toolkit/downsampling/gp_lttb/index.md)         | ✅       | ✅            |

### Financial analysis functions

**`candlestick_agg()` functions**

| Type             | Name                                                                                    | Toolkit | Experimental |
| ---------------- | --------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate        | [`candlestick_agg()`](/docs/reference/toolkit/candlestick_agg/candlestick_agg/index.md) | ✅       |              |
| Pseudo aggregate | [`candlestick()`](/docs/reference/toolkit/candlestick_agg/candlestick/index.md)         | ✅       |              |
| Accessor         | [`close()`](/docs/reference/toolkit/candlestick_agg/close/index.md)                     | ✅       |              |
|                  | [`close_time()`](/docs/reference/toolkit/candlestick_agg/close_time/index.md)           | ✅       |              |
|                  | [`high()`](/docs/reference/toolkit/candlestick_agg/high/index.md)                       | ✅       |              |
|                  | [`high_time()`](/docs/reference/toolkit/candlestick_agg/high_time/index.md)             | ✅       |              |
|                  | [`low()`](/docs/reference/toolkit/candlestick_agg/low/index.md)                         | ✅       |              |
|                  | [`low_time()`](/docs/reference/toolkit/candlestick_agg/low_time/index.md)               | ✅       |              |
|                  | [`open()`](/docs/reference/toolkit/candlestick_agg/open/index.md)                       | ✅       |              |
|                  | [`open_time()`](/docs/reference/toolkit/candlestick_agg/open_time/index.md)             | ✅       |              |
|                  | [`volume()`](/docs/reference/toolkit/candlestick_agg/volume/index.md)                   | ✅       |              |
|                  | [`vwap()`](/docs/reference/toolkit/candlestick_agg/vwap/index.md)                       | ✅       |              |
| Rollup           | [`rollup()`](/docs/reference/toolkit/candlestick_agg/rollup/index.md)                   | ✅       |              |

### Frequency analysis functions

**`count_min_sketch()` functions**

| Type      | Name                                                                                                          | Toolkit | Experimental |
| --------- | ------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`count_min_sketch()`](/docs/reference/toolkit/frequency-analysis/count_min_sketch/count_min_sketch/index.md) | ✅       | ✅            |
| Accessor  | [`approx_count()`](/docs/reference/toolkit/frequency-analysis/count_min_sketch/approx_count/index.md)         | ✅       | ✅            |

**`freq_agg()` functions**

| Type                | Name                                                                                            | Toolkit | Experimental |
| ------------------- | ----------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate           | [`freq_agg()`](/docs/reference/toolkit/frequency-analysis/freq_agg/freq_agg/index.md)           | ✅       | ✅            |
| Accessor            | [`into_values()`](/docs/reference/toolkit/frequency-analysis/freq_agg/into_values/index.md)     | ✅       |              |
|                     | [`max_frequency()`](/docs/reference/toolkit/frequency-analysis/freq_agg/max_frequency/index.md) | ✅       |              |
|                     | [`min_frequency()`](/docs/reference/toolkit/frequency-analysis/freq_agg/min_frequency/index.md) | ✅       |              |
|                     | [`topn()`](/docs/reference/toolkit/frequency-analysis/freq_agg/topn/index.md)                   | ✅       |              |
| Alternate aggregate | [`mcv_agg()`](/docs/reference/toolkit/frequency-analysis/freq_agg/mcv_agg/index.md)             | ✅       |              |
| Rollup              | [`rollup()`](/docs/reference/toolkit/frequency-analysis/freq_agg/rollup/index.md)               | ✅       |              |

### Gapfilling functions

| Type         | Name                                                                                                                   | Toolkit | Experimental |
| ------------ | ---------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Bucket       | [`time_bucket_gapfill()`](/docs/reference/timescaledb/hyperfunctions/time_bucket_gapfill/time_bucket_gapfill/index.md) |         |              |
| Interpolator | [`interpolate()`](/docs/reference/timescaledb/hyperfunctions/time_bucket_gapfill/interpolate/index.md)                 |         |              |
|              | [`locf()`](/docs/reference/timescaledb/hyperfunctions/time_bucket_gapfill/locf/index.md)                               |         |              |

### Minimum and maximum functions

**`max_n()` functions**

| Type      | Name                                                                                      | Toolkit | Experimental |
| --------- | ----------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`max_n()`](/docs/reference/toolkit/minimum-and-maximum/max_n/max_n/index.md)             | ✅       |              |
| Accessor  | [`into_values()`](/docs/reference/toolkit/minimum-and-maximum/max_n/into_values/index.md) | ✅       |              |
|           | [`into_array()`](/docs/reference/toolkit/minimum-and-maximum/max_n/into_array/index.md)   | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/minimum-and-maximum/max_n/rollup/index.md)           | ✅       |              |

**`max_n_by()` functions**

| Type      | Name                                                                                         | Toolkit | Experimental |
| --------- | -------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`max_n_by()`](/docs/reference/toolkit/minimum-and-maximum/max_n_by/max_n_by/index.md)       | ✅       |              |
| Accessor  | [`into_values()`](/docs/reference/toolkit/minimum-and-maximum/max_n_by/into_values/index.md) | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/minimum-and-maximum/max_n_by/rollup/index.md)           | ✅       |              |

**`min_n()` functions**

| Type      | Name                                                                                      | Toolkit | Experimental |
| --------- | ----------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`min_n()`](/docs/reference/toolkit/minimum-and-maximum/min_n/min_n/index.md)             | ✅       |              |
| Accessor  | [`into_array()`](/docs/reference/toolkit/minimum-and-maximum/min_n/into_array/index.md)   | ✅       |              |
|           | [`into_values()`](/docs/reference/toolkit/minimum-and-maximum/min_n/into_values/index.md) | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/minimum-and-maximum/min_n/rollup/index.md)           | ✅       |              |

**`min_n_by()` functions**

| Type      | Name                                                                                         | Toolkit | Experimental |
| --------- | -------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`min_n_by()`](/docs/reference/toolkit/minimum-and-maximum/min_n_by/min_n_by/index.md)       | ✅       |              |
| Accessor  | [`into_values()`](/docs/reference/toolkit/minimum-and-maximum/min_n_by/into_values/index.md) | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/minimum-and-maximum/min_n_by/rollup/index.md)           | ✅       |              |

### Percentile approximation functions

**`tdigest()` functions**

| Type      | Name                                                                                                                   | Toolkit | Experimental |
| --------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`tdigest()`](/docs/reference/toolkit/percentile-approximation/tdigest/tdigest/index.md)                               | ✅       |              |
| Accessor  | [`approx_percentile()`](/docs/reference/toolkit/percentile-approximation/tdigest/approx_percentile/index.md)           | ✅       |              |
|           | [`approx_percentile_rank()`](/docs/reference/toolkit/percentile-approximation/tdigest/approx_percentile_rank/index.md) | ✅       |              |
|           | [`mean()`](/docs/reference/toolkit/percentile-approximation/tdigest/mean/index.md)                                     | ✅       |              |
|           | [`num_vals()`](/docs/reference/toolkit/percentile-approximation/tdigest/num_vals/index.md)                             | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/percentile-approximation/tdigest/rollup/index.md)                                 | ✅       |              |

**`percentile_agg()` / `uddsketch()` functions**

| Type                | Name                                                                                                                     | Toolkit | Experimental |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ------------ |
| Aggregate           | [`percentile_agg()`](/docs/reference/toolkit/percentile-approximation/uddsketch/percentile_agg/index.md)                 | ✅       |              |
| Alternate aggregate | [`uddsketch()`](/docs/reference/toolkit/percentile-approximation/uddsketch/uddsketch/index.md)                           | ✅       |              |
| Accessor            | [`approx_percentile()`](/docs/reference/toolkit/percentile-approximation/uddsketch/approx_percentile/index.md)           | ✅       |              |
|                     | [`approx_percentile_rank()`](/docs/reference/toolkit/percentile-approximation/uddsketch/approx_percentile_rank/index.md) | ✅       |              |
|                     | [`error()`](/docs/reference/toolkit/percentile-approximation/uddsketch/error/index.md)                                   | ✅       |              |
|                     | [`mean()`](/docs/reference/toolkit/percentile-approximation/uddsketch/mean/index.md)                                     | ✅       |              |
|                     | [`num_vals()`](/docs/reference/toolkit/percentile-approximation/uddsketch/num_vals/index.md)                             | ✅       |              |
| Rollup              | [`rollup()`](/docs/reference/toolkit/percentile-approximation/uddsketch/rollup/index.md)                                 | ✅       |              |

### Saturating math functions

| Type     | Name                                                                                          | Toolkit | Experimental |
| -------- | --------------------------------------------------------------------------------------------- | ------- | ------------ |
| Function | [`saturating_add()`](/docs/reference/toolkit/saturating-math/saturating_add/index.md)         | ✅       |              |
|          | [`saturating_add_pos()`](/docs/reference/toolkit/saturating-math/saturating_add_pos/index.md) | ✅       |              |
|          | [`saturating_mul()`](/docs/reference/toolkit/saturating-math/saturating_mul/index.md)         | ✅       |              |
|          | [`saturating_sub()`](/docs/reference/toolkit/saturating-math/saturating_sub/index.md)         | ✅       |              |
|          | [`saturating_sub_pos()`](/docs/reference/toolkit/saturating-math/saturating_sub_pos/index.md) | ✅       |              |

### State tracking functions

**`compact_state_agg()` functions**

| Type      | Name                                                                                                                       | Toolkit | Experimental |
| --------- | -------------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`compact_state_agg()`](/docs/reference/toolkit/state-tracking/compact_state_agg/compact_state_agg/index.md)               | ✅       | ✅            |
| Accessor  | [`duration_in()`](/docs/reference/toolkit/state-tracking/compact_state_agg/duration_in/index.md)                           | ✅       | ✅            |
|           | [`interpolated_duration_in()`](/docs/reference/toolkit/state-tracking/compact_state_agg/interpolated_duration_in/index.md) | ✅       | ✅            |
|           | [`into_values()`](/docs/reference/toolkit/state-tracking/compact_state_agg/into_values/index.md)                           | ✅       | ✅            |
| Rollup    | [`rollup()`](/docs/reference/toolkit/state-tracking/compact_state_agg/rollup/index.md)                                     | ✅       | ✅            |

**`heartbeat_agg()` functions**

| Type      | Name                                                                                                             | Toolkit | Experimental |
| --------- | ---------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`heartbeat_agg()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/heartbeat_agg/index.md)                 | ✅       |              |
| Accessor  | [`dead_ranges()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/dead_ranges/index.md)                     | ✅       |              |
|           | [`downtime()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/downtime/index.md)                           | ✅       |              |
|           | [`interpolate()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/interpolate/index.md)                     | ✅       |              |
|           | [`interpolated_downtime()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/interpolated_downtime/index.md) | ✅       |              |
|           | [`interpolated_uptime()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/interpolated_uptime/index.md)     | ✅       |              |
|           | [`live_ranges()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/live_ranges/index.md)                     | ✅       |              |
|           | [`num_gaps()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/num_gaps/index.md)                           | ✅       |              |
|           | [`live_at()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/live_at/index.md)                             | ✅       |              |
|           | [`num_live_ranges()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/num_live_ranges/index.md)             | ✅       |              |
|           | [`trim_to()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/trim_to/index.md)                             | ✅       |              |
|           | [`uptime()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/uptime/index.md)                               | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/state-tracking/heartbeat_agg/rollup/index.md)                               | ✅       |              |

**`state_agg()` functions**

| Type      | Name                                                                                                                     | Toolkit | Experimental |
| --------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ------------ |
| Aggregate | [`state_agg()`](/docs/reference/toolkit/state-tracking/state_agg/state_agg/index.md)                                     | ✅       |              |
| Accessor  | [`duration_in()`](/docs/reference/toolkit/state-tracking/state_agg/duration_in/index.md)                                 | ✅       |              |
|           | [`interpolated_duration_in()`](/docs/reference/toolkit/state-tracking/state_agg/interpolated_duration_in/index.md)       | ✅       |              |
|           | [`interpolated_state_periods()`](/docs/reference/toolkit/state-tracking/state_agg/interpolated_state_periods/index.md)   | ✅       |              |
|           | [`interpolated_state_timeline()`](/docs/reference/toolkit/state-tracking/state_agg/interpolated_state_timeline/index.md) | ✅       |              |
|           | [`into_values()`](/docs/reference/toolkit/state-tracking/state_agg/into_values/index.md)                                 | ✅       |              |
|           | [`state_at()`](/docs/reference/toolkit/state-tracking/state_agg/state_at/index.md)                                       | ✅       |              |
|           | [`state_periods()`](/docs/reference/toolkit/state-tracking/state_agg/state_periods/index.md)                             | ✅       |              |
|           | [`state_timeline()`](/docs/reference/toolkit/state-tracking/state_agg/state_timeline/index.md)                           | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/state-tracking/state_agg/rollup/index.md)                                           | ✅       |              |

### Statistical and regression analysis functions

**`stats_agg()` (one variable) functions**

| Type      | Name                                                                                                                                  | Toolkit | Experimental |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`stats_agg()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/stats_agg/index.md) (one variable) | ✅       |              |
| Accessor  | [`average()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/average/index.md)                    | ✅       |              |
|           | [`num_vals()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/num_vals/index.md)                  | ✅       |              |
|           | [`kurtosis()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/kurtosis/index.md)                  | ✅       |              |
|           | [`skewness()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/skewness/index.md)                  | ✅       |              |
|           | [`stddev()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/stddev/index.md)                      | ✅       |              |
|           | [`sum()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/sum/index.md)                            | ✅       |              |
|           | [`variance()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/variance/index.md)                  | ✅       |              |
| Rollup    | [`rolling()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/rolling/index.md)                    | ✅       |              |
|           | [`rollup()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-one-variable/rollup/index.md)                      | ✅       |              |

**`stats_agg()` (two variables) functions**

| Type      | Name                                                                                                                                        | Toolkit | Experimental |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`stats_agg()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/stats_agg/index.md) (two variables)     | ✅       |              |
| Accessor  | [`average_y()`, `average_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/average_y_x/index.md)    | ✅       |              |
|           | [`corr()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/corr/index.md)                               | ✅       |              |
|           | [`covariance()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/covariance/index.md)                   | ✅       |              |
|           | [`determination_coeff()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/determination_coeff/index.md) | ✅       |              |
|           | [`intercept()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/intercept/index.md)                     | ✅       |              |
|           | [`kurtosis_y()`, `kurtosis_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/kurtosis_y_x/index.md) | ✅       |              |
|           | [`num_vals()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/num_vals/index.md)                       | ✅       |              |
|           | [`skewness_y()`, `skewness_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/skewness_y_x/index.md) | ✅       |              |
|           | [`slope()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/slope/index.md)                             | ✅       |              |
|           | [`stddev_y()`, `stddev_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/stddev_y_x/index.md)       | ✅       |              |
|           | [`sum_y()`, `sum_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/sum_y_x/index.md)                | ✅       |              |
|           | [`variance_y()`, `variance_x()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/variance_y_x/index.md) | ✅       |              |
|           | [`x_intercept()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/x_intercept/index.md)                 | ✅       |              |
| Rollup    | [`rolling()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/rolling/index.md)                         | ✅       |              |
|           | [`rollup()`](/docs/reference/toolkit/statistical-and-regression-analysis/stats_agg-two-variables/rollup/index.md)                           | ✅       |              |

### Time weighted calculations functions

**`time_weight()` functions**

| Type      | Name                                                                                            | Toolkit | Experimental |
| --------- | ----------------------------------------------------------------------------------------------- | ------- | ------------ |
| Aggregate | [`time_weight()`](/docs/reference/toolkit/time_weight/time_weight/index.md)                     | ✅       |              |
| Accessor  | [`average()`](/docs/reference/toolkit/time_weight/average/index.md)                             | ✅       |              |
|           | [`first_time()`](/docs/reference/toolkit/time_weight/first_time/index.md)                       | ✅       |              |
|           | [`first_val()`](/docs/reference/toolkit/time_weight/first_val/index.md)                         | ✅       |              |
|           | [`integral()`](/docs/reference/toolkit/time_weight/integral/index.md)                           | ✅       |              |
|           | [`interpolated_average()`](/docs/reference/toolkit/time_weight/interpolated_average/index.md)   | ✅       |              |
|           | [`interpolated_integral()`](/docs/reference/toolkit/time_weight/interpolated_integral/index.md) | ✅       |              |
|           | [`last_time()`](/docs/reference/toolkit/time_weight/last_time/index.md)                         | ✅       |              |
|           | [`last_val()`](/docs/reference/toolkit/time_weight/last_val/index.md)                           | ✅       |              |
| Rollup    | [`rollup()`](/docs/reference/toolkit/time_weight/rollup/index.md)                               | ✅       |              |

### General functions

| Type               | Name                                                                                                                         | Toolkit | Experimental |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------- | ------------ |
| Bucket             | [`time_bucket()`](/docs/reference/timescaledb/hyperfunctions/time-series-utilities/time_bucket/index.md)                     |         |              |
| One step aggregate | [`approximate_row_count()`](/docs/reference/timescaledb/hyperfunctions/distribution-analysis/approximate_row_count/index.md) |         |              |
|                    | [`first()`](/docs/reference/timescaledb/hyperfunctions/time-series-utilities/first/index.md)                                 |         |              |
|                    | [`histogram()`](/docs/reference/timescaledb/hyperfunctions/distribution-analysis/histogram/index.md)                         |         |              |
|                    | [`last()`](/docs/reference/timescaledb/hyperfunctions/time-series-utilities/last/index.md)                                   |         |              |
| One step operation | [`days_in_month()`](/docs/reference/timescaledb/hyperfunctions/time-series-utilities/days_in_month/index.md)                 | ✅       |              |
|                    | [`month_normalize()`](/docs/reference/timescaledb/hyperfunctions/time-series-utilities/month_normalize/index.md)             | ✅       |              |

For more information about each of the API calls listed in this table, see the [hyperfunction API documentation](/docs/reference/timescaledb/hyperfunctions/index.md).

## Function pipelines

Function pipelines are an experimental feature, designed to radically improve the developer ergonomics of analyzing data in PostgreSQL and SQL, by applying principles from functional programming and popular tools like Python’s Pandas, and PromQL.

SQL is the best language for data analysis, but it is not perfect, and at times can get quite unwieldy. For example, this query gets data from the last day from the measurements table, sorts the data by the time column, calculates the delta between the values, takes the absolute value of the delta, and then takes the sum of the result of the previous steps:

```
SELECT device_id,
sum(abs_delta) as volatility
FROM (
 SELECT device_id,
abs(val - lag(val) OVER last_day) as abs_delta
FROM measurements
WHERE ts >= now()-'1 day'::interval) calc_delta
GROUP BY device_id;
```

You can express the same query with a function pipeline like this:

```
SELECT device_id,
 timevector(ts, val) -> sort() -> delta() -> abs() -> sum() as volatility
FROM measurements
WHERE ts >= now()-'1 day'::interval
GROUP BY device_id;
```

Function pipelines are completely SQL compliant, meaning that any tool that speaks SQL is able to support data analysis using function pipelines.

For more information about how function pipelines work, read the [blog post](https://www.tigerdata.com/blog/function-pipelines-building-functional-programming-into-postgresql-using-custom-operators).

## TimescaleDB Toolkit feature development

TimescaleDB Toolkit features are developed in the open. As features are developed they are categorized as experimental, beta, stable, or deprecated. This documentation covers the stable features, but more information on experimental features in development can be found in the [Toolkit repository](https://github.com/timescale/timescale-analytics/tree/main/docs).

## Contribute to TimescaleDB Toolkit

We want and need your feedback! What are the frustrating parts of analyzing time-series data? What takes far more code than you feel it should? What runs slowly, or only runs quickly after many rewrites? We want to solve community-wide problems and incorporate as much feedback as possible.

- Join the [discussion](https://github.com/timescale/timescale-analytics/discussions).
- Check out the [proposed features](https://github.com/timescale/timescale-analytics/labels/proposed-feature).
- Explore the current [feature requests](https://github.com/timescale/timescale-analytics/labels/feature-request).
- Add your own [feature request](https://github.com/timescale/timescale-analytics/issues/new?assignees=\&labels=feature-request\&template=feature-request.md\&title=).

## Learn more

- [Gapfilling and interpolation](/docs/build/data-management/hyperfunctions/gapfilling-interpolation/index.md): Fill gaps in time-series query results.
- [Function pipelines](/docs/build/data-management/hyperfunctions/function-pipelines/index.md): Chain hyperfunctions together for cleaner analytics queries.
- [Use time buckets](/docs/learn/data-lifecycle/time-buckets/use-time-buckets/index.md): SQL examples for grouping data by time intervals.
- [Install TimescaleDB Toolkit](/docs/deploy/self-hosted/tooling/install-toolkit/index.md): Set up the Toolkit extension for self-hosted deployments.
- [Hyperfunctions API reference](/docs/reference/timescaledb/hyperfunctions/index.md): Full API reference for all built-in hyperfunctions.
- [TimescaleDB Toolkit API reference](/docs/reference/toolkit/index.md): Full API reference for Toolkit hyperfunctions.
