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

SQL for returning time series as contiguous tranches?

$
0
0

Is there a way to select from a hypertable data grouped by tranches of contiguous data?

I have a table that has 10hz data, but that data sent via RF transmission and then written to timescale, so there are often gaps between groups of data (The transmission is best effort, and gives up easily so as to not create a retry storm, and frankly I’m just a consumer of the data once its received by the producer, have not control to improve or change that strategy).

If I select from the table the data between two timestamps, can SQL group the data into an array of tranches that have all rows within 1s? So basically any time gap in the data larger than 1s will start a new tranch.

I’m currentlyl gathering the data in one select statement and then dividing it into tranches at the application layer, but this seems inefficient. I suspect my SQLfu is not up to snuff here, and curious if there is a way that I can make Postgresql/Timescale do this for me.

TIA

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 294

Trending Articles