Questions tagged [timescaledb]

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension. QUESTIONS MUST BE ABOUT PROGRAMMING in order to be on-topic on Stack Overflow. Specifically, database administration is not on-topic for Stack Overflow.

TimescaleDB

TimescaleDB is an open-source database designed to make SQL scalable for time-series data. It is engineered up from PostgreSQL, providing automatic partitioning across time and space (partitioning key). It speaks full SQL and is correspondingly easy to use like a traditional relational database, yet scales in ways previously reserved for NoSQL databases.

Compared to the trade-offs demanded by these two alternatives (relational vs. NoSQL), TimescaleDB offers the best of both worlds for time-series data:

Features

Easy to Use

  • Full SQL interface for all SQL natively supported by PostgreSQL (including secondary indexes, non-time based aggregates, sub-queries, JOINs, window functions).
  • Connects to any client or tool that speaks PostgreSQL, no changes needed.
  • Time-oriented features, API functions, and optimizations.
  • Robust support for Data retention policies.

Scalable

  • Transparent time/space partitioning for both scaling up (single node) and scaling out (forthcoming).
  • High data write rates (including batched commits, in-memory indexes, transactional support, support for data backfill).
  • Right-sized chunks (two-dimensional data partitions) on single nodes to ensure fast ingest even at large data sizes.
  • Parallelized operations across chunks and servers.

Reliable

  • Engineered up from PostgreSQL, packaged as an extension.
  • Proven foundations benefiting from 20+ years of PostgreSQL research (including streaming replication, backups).
  • Flexible management options (compatible with existing PostgreSQL ecosystem and tooling).

Resources

691 questions
6
votes
3 answers

SQL Time Series Group with max amount of results

I have timeseries data in a table using Timescaledb. Data is as follows: time locationid parameterid unitid value 2022-04-18T10:00:00.000Z "1" "1" "2" 2.2 2022-04-18T10:00:00.000Z "2" "1" …
gsmith1515
  • 179
  • 9
6
votes
4 answers

how to segment and get the time between two dates?

I have the following table: id | number_of _trip | start_date | end_date | seconds 1 637hui 2022-03-10 01:20:00 2022-03-10 01:32:00 720 2 384nfj 2022-03-10 02:18:00 2022-03-10 02:42:00 …
Isra
  • 182
  • 2
  • 14
6
votes
1 answer

Real-Time aggregation not up to date

I am experiencing real time aggregation not to be up to date in real time. Is there something I am missing? A reproducible example on version 2.4.2 using the current docker image timescale/timescaledb:latest-pg12: CREATE TABLE data ( time …
Pasukaru
  • 1,050
  • 1
  • 10
  • 22
6
votes
1 answer

Selecting a continuous aggregate is slower than selecting raw data in timescaledb

In my database (Postgresql 12; timescaleDB 1.7.0) there are multiple metrics tables containing one row per minute and device. It contains a deviceId, the time, four doubles and an enum value. There are different time based queries to analyze the…
fhueser
  • 599
  • 3
  • 16
6
votes
1 answer

how to change the chunk time interval?

how can we change the chunk time interval, when it is way too large? use case: we have an existing hypertable, where we have set the chunk_time_interval to 1 month (when using create_hypertable()). this was fine for the last months, but now the…
TmTron
  • 17,012
  • 10
  • 94
  • 142
6
votes
1 answer

Why PostgreSQL(timescaledb) costs more storage in table?

I'm new to database. Recently I start using timescaledb, which is an extension in PostgreSQL, so I guess this is also PostgreSQL related. I observed a strange behavior. I calculated my table structure, 1 timestamp, 2 double, so totally 24bytes per…
Xiang Zhang
  • 2,831
  • 20
  • 40
5
votes
3 answers

SQL query for finding latest or max value of timestamp from table corresponding to N ids Timescaledb

I have a table tab1 in timescale db which has 3 columns tag, time, value. time and tag make up the pk for the table: (time, tag). There are more than 500 lakhs (50 000 000) of rows. I need to find the latest timestamp or the max(time) for each of…
5
votes
1 answer

Very slow continuous aggregate on large hypertable

I am using the latest docker version of Postgres 14.3 and Timescale 2.7.0. I am running some benchmarks to make sure timescaledb is the right solution for my client. I have a hypertable with 50 million rows. These were inserted in (approximately)…
jbx
  • 21,365
  • 18
  • 90
  • 144
5
votes
0 answers

TimescaleDB materialized view performance

I'm facing some performance issues with TimescaleDB continuous aggregates, and I don't fully understand why it happens. I have a table for my timeseries data: CREATE TABLE IF NOT EXISTS ack_alarm_number ( time TIMESTAMP NOT NULL, …
Oldook
  • 107
  • 5
5
votes
1 answer

TimescaleDB: SELECT COUNT(*) slow on hypertable

I have a hyper table for exchange candle data set up using TimescaleDB. TimescaleDB official image timescale/timescaledb:latest-pg12 set up and running with Docker with the exact version string starting PostgreSQL 12.6 on x86_64-pc-linux-musl,…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
5
votes
1 answer

How does TimescaleDB backup continuous aggregates when they're materialized views?

I've been trying out TimescaleDB and I can't understand how backups work with the following system? timeseries hypertable -> aggregated by a MATERIALIZED VIEW continuous aggregate Now if I have a data retention policy on the timeseries table that…
5
votes
1 answer

Different result beween eloquent query and the same associated SQL query (got with toSql() method ) with Laravel

I have this query in Laravel Eloquent: $measures = Measure::groupBy('time') ->selectRaw('time, sum("delta") as sum_delta, sum("redistributed") as sum_redistr') ->where('operation_id', 'ACC0000001') ->where('time', '>',…
Juliatzin
  • 18,455
  • 40
  • 166
  • 325
5
votes
2 answers

TimescaleDB/Postgres taking up far more space than expected

I've been saving some tick data in TimescaleDB and have been surprised at how much space it's been taking up. I'm pretty new to this but I'm saving roughly 10 million rows a day into a table that has the following columns: This has been taking up…
HHH
  • 149
  • 2
  • 12
5
votes
1 answer

What is space partitioning and dimensions in TimesclaleDB

I am new to the timescale database. I was learning about chunks and how to create chunks based on time. But there is another time/space chunking which is confusing me a lot. Please help me with below queries. What is a dimension in a timescale…
sachin thakur
  • 91
  • 2
  • 9
5
votes
2 answers

Gap Filling OHLCV (Open High Low Close Volume) in TimescaleDB

I have some OHLCV data stored in TimescaleDB which contains missing data during certain time ranges. This data needs to be resampled to a different time period (i.e. 1 day) and contain contiguous, ordered time buckets. TimescaleDB provides the…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
1
2
3
45 46