v.25.6New Feature

TimeSeries* helper functions to speedup some scenarios

timeSeries* helper functions to speedup some scenarios when working with time series data: - re-sample the data to the time grid with specified start timestamp, end timestamp and step - calculate PromQL-like delta, rate, idelta and irate. #80590 (Alexander Gololobov).
timeSeries* helper functions for efficient processing of time series data, including resampling to a specified time grid and computing PromQL-like functions such as delta, rate, idelta, and irate.

Why it matters

This feature addresses the need for streamlined and efficient time series data handling in ClickHouse. It simplifies common operations like resampling data points within a defined time range and step, and computing standard time series metrics similar to Prometheus Query Language (PromQL). This helps users analyze and transform time series data more easily and with better performance.

How to use it

Users can leverage the new timeSeries* functions by specifying parameters such as start timestamp, end timestamp, and step duration to resample their time series data. Additionally, the PromQL-like functions (delta, rate, idelta, irate) can be applied directly to compute relevant metrics over the series. These functions are used within SQL queries, for example:

SELECT timeSeriesResample(time_series_column, start, end, step) FROM table;
SELECT timeSeriesDelta(time_series_column) FROM table;