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
29
votes
1 answer

how to get timescaledb version of the database

According to the docs: TimescaleDB supports having different extension versions on different databases within the same PostgreSQL instance. I can get the installed version of the instance with this SQL command: SELECT extversion FROM…
TmTron
  • 17,012
  • 10
  • 94
  • 142
23
votes
5 answers

How to create TimescaleDB Hypertable with time partitioning on non unique timestamp?

I have just started to use TimescaleDB and want to create a hypertable on a table with events. Originally I thought of following the conventional pattern of: CREATE TABLE event ( id serial PRIMARY KEY, ts timestamp with time zone NOT NULL, …
jbx
  • 21,365
  • 18
  • 90
  • 144
18
votes
5 answers

TimescaleDB: Is it possible to call 'create_hypertable' from Python?

I want to create TimescaleDB tables in Postgres on the fly as I'm dealing with data sources that change (financial feeds, so could be 100, could be 1000) over time and I want one table per data source. I can create the tables no problem from Python,…
William Tonkin-Howe
  • 487
  • 1
  • 3
  • 12
14
votes
2 answers

Creating Hypertables through SQL Alchemy

Our current project relies heavily on SQL Alchemy for table creation/data insertion. We would like to switch to timescaledb's hypertables, but it seems the recommended way to create hypertables is by executing a create_hypertable command. I need…
wfawwer
  • 195
  • 2
  • 8
13
votes
2 answers

Can we install TimescaleDB as a postgres extension on AWS RDS for postgres?

A naive question on RDS: TimescaleDB acts as a postgres extension. As an AWS user, can I install TimescaleDB as a postgres extension on AWS RDS for postgres?
yuyang
  • 1,511
  • 2
  • 15
  • 40
12
votes
4 answers

TimescaleDB: efficiently select last row

I have a postgres database with the timescaledb extension. My primary index is a timestamp, and I would like to select the latest row. If I happen to know the latest row happened after a certain time, then I can use a query such as: query = 'select…
user123456789
  • 229
  • 3
  • 10
10
votes
1 answer

Not able to take backup of hypertable TimescaleDB database using pg_dump PostgreSQL

command used to take backup C:\Program Files\PostgreSQL\12\bin>pg_dump -h localhost -U postgres -p 5432 -Fc -f "D:\Database Backup\temp_10.bak" GESEMS_Performace_Test. Error : pg_dump: NOTICE: hypertable data are in the chunks, no data will be…
Akanksha
  • 133
  • 1
  • 2
  • 7
10
votes
1 answer

ERROR: cannot create a unique index without the column "date_time" (used in partitioning)

I just started using timescaleDB with postgresql. I have a database named storage_db which contains a table named day_ahead_prices. After installing timescaledb, I was following Migrate from the same postgresql database to migrate my storage_db into…
some_programmer
  • 3,268
  • 4
  • 24
  • 59
10
votes
2 answers

Add plpython3 Extension to Postgres/timescaledb Alpine Docker Image

I try to add the plpython3 extension to my timescaledb/postgres (based on linux alpine) image: FROM timescale/timescaledb:0.9.0-pg10 RUN set -ex \ && apk add --no-cache --virtual .plpython3-deps --repository…
Yannic Hamann
  • 4,655
  • 32
  • 50
9
votes
0 answers

How to COPY into one PostgreSQL table in parallel without lock?

As I see in pg_stat_activiry, only one of COPY command executes at once. Other queries are in Lock state as I see in wait_event_type column. How can I run several COPY mytable FROM STDIN in parallel without locking table? ps. mytable is hypertable…
Nick
  • 9,735
  • 7
  • 59
  • 89
8
votes
2 answers

What is timeseries data cardinality?

I've seen few places which give definition of time-series cardinality similar to: Assume you have 1000 IoT devices in 20 locations, they're running one of 5 firmware versions, and report input from 5 types of sensor per device. The cardinality of…
Alex des Pelagos
  • 1,170
  • 7
  • 8
8
votes
2 answers

Convert hypertable to regular postgres table

quite new to timescaledb and I'm struggling with a migration script. I'm trying to create migrations for a flask application with SQLAlchemy. Let's say I created a table (as in timescaledb docs) like the following: CREATE TABLE conditions ( time …
abrunet
  • 1,122
  • 17
  • 31
8
votes
1 answer

Sqlalchemy setup for postgresql with timescaledb extension

I was trying to hook up the sqlalchemy with my underlying postgresql, which uses the timescaledb extension. All queries work fine when I try them from the psql terminal client. But when I try to use python & sqlalchemy to do it, it keeps throwing me…
Yijie Tao
  • 127
  • 1
  • 6
7
votes
1 answer

How to Determine the Size of a TimescaleDB Table?

To determine the size of my TimescaleDB table my_table (which has a hypertable created previously), I ran the SQL query pg_size_pretty( pg_total_relation_size('my_table') ); However, despite having 10k rows in this table, the size returned from…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
7
votes
1 answer

Is logical replication using pglogical possible with timescaleDB?

I set up a fully functional logical replication of multiple masters to one slave. As soon as I convert any of the replicated tables to timescaleDB's hypertable, the replication stops working - only the structure is replicated, but no data. Is it…
Tom
  • 91
  • 7
1
2 3
45 46