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

Time window in PostgreSQL

I am new to PostgreSQL (specifically, I use Timescale db) and have a question regarding time windows. Data: date |customerid|names 2014-01-01|1 |Andrew 2014-01-02|2 |Pete 2014-01-03|2 |Andrew 2014-01-04|2 …
Dominik
  • 187
  • 2
  • 11
4
votes
1 answer

How to test timescaledb database using Python

I want to test a Timescale database using Python and pytest. I have discovered, that pytest-pqsql provides a database fixture to be used in testing. However, I am struggling to enable timescaledb support for it. I have gone through the following…
jmm
  • 384
  • 2
  • 12
4
votes
2 answers

Using Timescale DB's Gapfill with JOOQ throws argument: start cannot be NULL

I have a Timescale DB running and am using JOOQ to access the data. I am using gapfill() for dslContext .select(Routines.timeBucketGapfill5( Routines.createInterval(DURATION), table.TIME, null,…
4
votes
0 answers

Adding Timescaledb extension in postgres db in window cannot found timescaledb.control error

adding timescaledb extension in postgresql db by following command in windows. Command: CREATE EXTENSION IF NOT EXISTS timescaledb; Error: could not open extension control file "/usr/share/postgresql/9.5/extension/timescaledb.control": No such file…
yash
  • 63
  • 7
4
votes
1 answer

Column is of type timestamp without time zone but expression is of type character varying : Nifi

I am trying to insert CSV records to Postgres database using nifi. Sample csv file : timenow,location '2019-10-21 15:13:11','colombo' When nifi scenario runs, it gives following error Error column 'timenow' is of type timestamp without time zone…
Sachith Muhandiram
  • 2,819
  • 10
  • 45
  • 94
4
votes
1 answer

how to time_bucket by month with timescaleDB

As of this question, I know there is an open feature request to add month/year to the time_bucket function. My question is, what is the best way to accomplish this now. This issue mentions date_trunc Here are the two approaches: timescaledb's…
Jonathan
  • 16,077
  • 12
  • 67
  • 106
4
votes
1 answer

Timescale hypertable columns vs multiple tables/normalized schema

I am using Timescale DB to store measurements from many devices. Since most devices so far had a similar set of metrics, I used a hypertable with many columns (one for each metric). However, some new devices will have to support different metrics,…
Lou
  • 4,244
  • 3
  • 33
  • 72
4
votes
4 answers

How to efficiently get the last timestamp per asset without sequential scan on timescaledb?

I have a table | Asset | timestamp | open | high | low | close | volume | |-------|---------------|------|------|-----|-------|--------| | AAPL | 1551274920000 | 200 | 300 | 200 | 250 | 10240 | | AAPL | 1551274980000 | 201.4| 299.5| 200 |…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
4
votes
1 answer

jOOQ does not use custom data binding

I am trying to write a custom data type binding for PGInterval and Duration to use jOOQ together with TimescaleDB. Sadly jOOQ does not use it when generating functions for the database routines. Here's my binding class: import org.jooq.* import…
4
votes
1 answer

TimescalDB is slower than pure PostgreSQL

I setup TimescaleDB and Postgresql for testing performance on time-serial data. I have successful setup the hyper table. I test with inserted 2M rows from my C# program. But the TimescaleDB is process totally slower than pure Postgresql. Even with…
Thach Nguyen
  • 51
  • 1
  • 3
4
votes
1 answer

JOOQ and TimescaleDB - How to implement a basic time_bucket statement in JOOQ

I would like to implement a basic time_bucket statement in JOOQ. If I run this Statement in the console it works perfekly fine: SELECT time_bucket('5 minutes', time) as t, avg(average) from TABLE GROUP BY t If i try to implement it with JOOQ I have…
4
votes
1 answer

How do i divide my minute data into tables containing each month in Timescaledb (PostgreSQL extension)

I am new to timescaledb and I want to store one minute ohlcv ticks for each stock in the table. There are 1440 ticks generated daily for one stock and 43200 ticks a month. I have a 100 assets whose ticks I would like to store every month and…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
4
votes
0 answers

PostgreSQL : "WARNING: out of shared memory" on simple SELECT

Whenever I try to do a simple SELECT on my Postgres db, I get this error : tutorial=> select id from table LIMIT 1; WARNING: out of shared memory WARNING: out of shared memory WARNING: out of shared memory WARNING: out of shared memory WARNING:…
Raphiki
  • 190
  • 3
  • 11
4
votes
3 answers

creating pg_cron extension within docker-entrypoint-initdb.d fails

If I create the pg_cron extension in a docker-entrypoint-initdb.d/init.sql file, the docker image fails to run and docker logs just says "No such container." Here's the relevant .sql snippet: CREATE DATABASE my_database; \c my_database; CREATE…
Alex Leung
  • 41
  • 1
  • 4
3
votes
0 answers

TimescaleDB continuous aggregation custom time_bucket function

We have a device for temperature collecting, it is configured to collect the temperature of the refrigerator box each second in the buffer (but can collect even fewer periods 10ms, 100ms) and at the end of each minute it sends an average value for…
Sanprof
  • 369
  • 1
  • 6
  • 17