Quantcast
Channel: TimescaleDB and PostgreSQL - Timescale Community Forum
Viewing all articles
Browse latest Browse all 296

Downsampling Timeseries Data By time interval

$
0
0

Hello, I am trying to downsample time series data based off a time interval. gp_lttb looks promising but executing it seems to do the same exact thing as normal lttb even when I specify the optional time interval.

SELECT (dp).time AS timestamp, (dp).value
FROM (
SELECT unnest(toolkit_experimental.gp_lttb(
timestamp,
value,
INTERVAL ‘1 second’,
100
)) AS dp
FROM my_table
) sub;

This does the same thing as if I replace toolkit_experimental.gp_lttb with lttb but remove the time interval. Am I applying this wrong? I want a row for every second in my data but the output has timestamps that are on random timestamp values not aligned to a second. Maybe there is another function to do this?

I am using postgresql 17 with the following extensions installed

timescaledb | 2.17.2 | public | Enables scalable inserts and complex queries for time-series data (Community Edition)
timescaledb_toolkit | 1.19.0 | public | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 296

Trending Articles