As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [timescaledb]

TimescaleDB is an open source time-series extension of PostgreSQL. Use this tag for questions related to TimescaleDB. Also tag with the more general "time-series-databases".

Filter by
Sorted by
Tagged with
2 votes
1 answer
376 views

A complicated scenario with TimescaleDB and compression

We have a timescaleDB with a fairly large data set (> 1.5TB, >1B rows). The project has been running into one delay after another because we just can't make the queries we need to perform fast ...
0 votes
0 answers
23 views

postgresql with timescaledb backup/restore and upgrade issue

My customer is using TimescaleDB 2.3.1 at PostgreSQL 11.20. We are trying to upgrade PostgreSQL and Timescaledb currently I installed PostgreSQL 13.11 and and TimescaleDB 2.11.0 I backedup the ...
1 vote
2 answers
388 views

Optimizing table for timeseries Postgres data table

I have the below table which maintains a timeseries result. The row only becomes relevant when the signal is true, When signal is false, it just marks that for that particular timestamp we got a ...
0 votes
1 answer
773 views

Ways to optimize the PostgreSQL/TimeScaleDB query

What approaches I could take to optimize the performance of the following joinless query on the following PostgreSQL/TimeScaleDB table? So far, I managed to create the right index which is obviously ...
0 votes
0 answers
347 views

How to use timescale-bitnami image on Windows?

Since there are issues with collations in the default alpine-based timescaledb images, I tried to use the bitnami-image. But I get an error on startup. docker run ^ -p 5432:5432 ^ -v tsdb-bitnami:/...
2 votes
2 answers
340 views

Slow query for multiple data at same timestamp

Hi everyone, I'm currently facing a problem to query efficiently my database to retrieve all rows at same timestamp. I will explain, I have two table of data using TimescaleDb Hypertable with ...
0 votes
4 answers
115 views

Window function with subquery results to unexpectedly slow query plan

This is my victim query SELECT *, lag(quantity) over (partition by product_id, size_id, warehouse_id order by size_id, warehouse_id, created_at ASC) - quantity as orders FROM ...
0 votes
1 answer
106 views

Move timescaledb hypertable from a postgresql server to another one

I want to move a timescaledb hypertable that's on the terabytes order. I wanted to do something like the following: pg_dump -t "schema1"."table1" -h host1_ip -U username1 dbname1 | ...
1 vote
1 answer
96 views

Error while creating continuous aggregate (materialized view) when source and new time columns have the same name (PSQL/TSDB)

I'm facing a problem when creating a continuous aggregate on timescaledb (based on materialized views) when the source time column and the new time column have the same name like below: CREATE ...
0 votes
0 answers
5 views

js transform code applied to a postgres / timescale view

Let's assume this data type: timestamp INT ticker VARCHAR price NUMERIC with some example data: 0, A, 10 0, B, 100 1, A, 20 1, B, 1000 2, A, 30 2, B, 10000 ... And a JS function, implemented with ...
1 vote
1 answer
61 views

add_continuous_aggregate_policy does not exist, with timescale

One picture sums it all: The function is part of the public schema, but is it not found; it happens whether I put 'public.' or not in front of the function name. I'm using DataGrip and the ...
0 votes
0 answers
24 views

how to make joins on different tables based on the data retrieved, with TimeScale/Postgres

Here is a simplified version of the problem I'm trying to solve: Table A with id and some data: id, data A01, xxxx A02, xxxx ... Table B with id and some other kind of data id, data B01, xxxx B02, ...
0 votes
0 answers
79 views

Materialized view slow with Timescale

I have a table created like this: -- enable timescale plugin CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; -- create schema CREATE SCHEMA IF NOT EXISTS {schemaName}; -- create table CREATE ...
1 vote
1 answer
206 views

Unnest array of rows with a tagged column

I'm trying to create a query that will return data in this format: id time value 1 1 2.5 1 2 3.5 1 3 6.4 2 1 8.3 2 2 8.5 I'm using Timescaledb and wish to use one of their downsampling ...
1 vote
1 answer
484 views

How to determine which foreign keys are circular? As highlighted by warning from pg_dump

When carrying out pg_dump on a (timescale) database running within a local container I have the following: pg_dump: warning: there are circular foreign-key constraints on this table: pg_dump: ...
2 votes
2 answers
590 views

How to interpret "transactions per second"?

Short version: When I execute one transaction in IntelliJ, the "transactions per second" graph increases by 10 tx/sec - I only expect it to increase by 1. So, it seems that my understanding ...
0 votes
0 answers
156 views

Postgres and CopyManager, Database connection failed when starting copy at org.postgresql.core.PGStream.receiveChar

I'm trying to run copy mananger and load CSV file val pgConnection = conn.unwrap(classOf[PgConnection]) val copyManager = new CopyManager(pgConnection) val fis = new FileInputStream(tempTsvFilePath....
2 votes
1 answer
1k views

Can't do simple query or drop table due to out of memory error, but pg_locks return no lock

I received this out of memory error when trying to drop a large table (70GB including index) but couldn't identify the root cause from pg_locks view DROP TABLE big_table; ERROR: out of shared memory ...
0 votes
1 answer
71 views

Database to save measurements

I am creating an infrastructure to save measurements coming from a fleet of around 2000 cars. Each car contains about 60 sensors (depending from car) with a sum of about 800 values par second coming ...
5 votes
3 answers
133 views

Select telemetry data based on relational data in PostgreSQL/TimescaleDB

I'm trying to solve a particularly difficult problem. I am storing some telemetry data from some sensors in an SQL table (PostgreSQL) and I want to know how I can I write a query that will group the ...
0 votes
0 answers
202 views

TimescaleDb : How to store long time events?

I’m trying to use TimescaleDb to store long time events (events started for example 2 days ago and ended 1 hour ago). There are two types of events (current events without end date and historical ...
1 vote
1 answer
1k views

PostgreSQL does not start: FATAL: xlog flush request is not satisfied --- flushed only to 0

I have a Docker PostgreSQL (TimescaleDB) developer instance with a local Linux volume mapping. version: '3' services: dex-timeseriesdb: image: timescale/timescaledb:latest-pg12 # https://...
3 votes
1 answer
406 views

I can't understand a syntax error issue in SQL / TimeScaleDB

This does NOT compile: SELECT add_compression_policy( hypertable => 'exchange.candles', compress_after => INTERVAL ((SELECT now()::DATE::timestamp - (SELECT min(last_ts) FROM exchange....
1 vote
0 answers
291 views

Improve TimescaleDB aggregate query execution time

Schema The following database schema is realized in a PostgreSQL 14.2 database with TimescaleDB 2.5.1: Indexes on tables exist for primary and foreign keys. As an example, this is the output of \d ...
0 votes
2 answers
233 views

How to check whether TimescaleDB view is defined `WITH DATA` or `WITH NO DATA`?

TimescaleDB materialized view can be created with or without DATA. Normal Postgres way to check view definition does not have trailing pragmas including DATA. # \sv wmd # select pg_get_viewdef('wmd', ...
2 votes
2 answers
145 views

PostgreSQL (TimescaleDB) asynchronous replication (WAL) doesn't work

I'm trying to setup asynchronous replication of a PostgreSQL (TimescaleDB) database. I've been following numerous of guides, and even after trying things from documentation it doesn't seem to work. I ...
2 votes
2 answers
291 views

Index not picked up on nullable boolean column

I have 2 TimescaleDB Databases (PROD and DEV), both have a hypertable with the same schema and almost the same data (44M rows for the first one, 40M for the 2nd one). I have to query some data on a ...
2 votes
2 answers
407 views

Wall clock hourly buckets out of time intervals with postgres or timescale

I have a record of session durations with start and end timestamps: user_id | session_id | session_start | session_end --------+------------+-------------------------------+------------...
0 votes
0 answers
559 views

Installing older versions of timescaledb for postgresql on macos

I'm running postgresql 14.1 on MacOs Monterey, this was installed as a requirement of timescaledb which is at version 2.5.1. I had issues while installing timescaledb with another version of ...
3 votes
0 answers
411 views

Improve performance of view based on TSDB continuous aggregation

I am currently trying to create a (materialized) view which is based on a TSDB (timescale DB) continuous aggregation. Some context: I have a table which takes consumption data of meters through a ...
1 vote
0 answers
105 views

How to speed up GroupAggregate

https://explain.depesz.com/s/I2IN I have a query against a TimescaleDB 1.7 hypertable on Postgresql 12. Lots of joins to other table. When I do the grouping it seems to take a lot of time, I switched ...
3 votes
1 answer
404 views

Is it ok or how to backfilling an uncompressed hypertable in TimescaleDB?

For PostgreSQL (v13.4) with TimescaleDB (v2.4.1) Created a hyper table, with each day as a chunk, and I found a day in last month is missing, so I've inserted those data of the missing day into the ...
1 vote
2 answers
803 views

parallelize select/insert for postgresql

I have a relatively big postgresql table (timescaleDB), 200GB ~ 1B rows, index by timestamp and id. I realize a lot of times, my very task is only handled by 1 process. I believe my query can be split ...
2 votes
1 answer
241 views

Are out of order inserts an issue?

I am running a PostgreSQL database that is logging state-of-health information for a number of systems. At the moment, it is running on a standard PostgreSQL server, but it seems like TimescaleDB has ...
1 vote
0 answers
158 views

timescaleDB insertion speed issue

I’m trying to use pandas to interact with timescaleDB. I initiate my DB in DBeaver with the following CREATE TABLE db_009a005a_df_downloaded_grand ( symbol VARCHAR(32), timestamp TIMESTAMP ...
2 votes
1 answer
472 views

TimescaleDB on Azure Postgres error when creating continuous aggregation

I am getting the following error SQL Error [0A000]: ERROR: functionality not supported under the current license "ApacheOnly", license¶ Hint: Upgrade to a Timescale-licensed binary to ...
2 votes
0 answers
186 views

How to optimize for performance when querying millions of rows in real-time analytics?

Suppose I have a simple table called events like this: timestamp event_id action_count apr 5 01:05:00 foo 10 apr 5 01:04:15 bar 20 apr 5 01:06:10 baz 200 apr 5 01:04:30 baz 5 apr 5 01:03:00 baz ...
2 votes
1 answer
761 views

timescaledb: Bulk insert exhausts all memory

Summary I am attempting to insert data into a timescaledb hypertable in bulk. Regardless of what I try, the memory usage grows gradually until the server process is killed due to a lack of memory. I ...
1 vote
2 answers
2k views

High autovacuum CPU/IO usage from database with more than 10k append-only tables

In my system I have more than 10k tables that are very similar, I only do insert operations in these tables and delete old data via a cron schedule one time per day. These insertions come each minute, ...
3 votes
2 answers
894 views

On docker volume restore: could not access file "$libdir/timescaledb-1.6.0": No such file or directory

I am trying to restore TimescaleDB data from one ubuntu machine to another ubuntu machine. On the both machines we have deployed TimescaleDB through docker and using the same tag. Docker image used: ...
0 votes
1 answer
140 views

How to quickly return the number of rows in a distributed hypertable with more than 100 million rows in TimescaleDB?

In a 'vanilla' PostgreSQL 12.7 database, I generally run the following query to learn the estimated number of rows in tables with 100+ million rows: ----------------------------------------------------...
1 vote
1 answer
367 views

Database architecture of high frequency sensor values

I have a lot of sensors (around 1000) and want to save their values. The sensors will mostly work around a sampling rate of 10Hz. Regular queries will be used for a live-view application. It can be ...
2 votes
1 answer
153 views

TimescaleDB database design - should I use inheritance?

I have the following TimescaleDB hypertable: CREATE TABLE public.data ( event_time timestamp with time zone NOT NULL, pair_id integer NOT NULL, entry_id bigint NOT NULL, event_data1 ...
2 votes
2 answers
2k views

Converting PostgreSQL table to TimescaleDB hypertable

I have a PostgreSQL table which I am trying to convert to a TimescaleDB hypertable. The table looks as follows: CREATE TABLE public.data ( event_time timestamp with time zone NOT NULL, ...
0 votes
1 answer
1k views

postgres read query resample time series data for hourly averages

I am new to SQL trying to learn how to do read queries on time series data. Can someone give me a tip on how to resample interval time series data to hourly averages on the postgres read query? My ...
5 votes
1 answer
235 views

Non-deterministic performance of query on select, from 1s to 60s on table with 1 billion rows

I'm trying to investigate why the performance of this query is so non-deterministic. It can take anywhere from 1 seconds, to 60 seconds and above. The nature of the query is to select a "time ...
2 votes
0 answers
864 views

Multiple tables vs rows for timescaledb / postgresql

I am designing a postgresql/timescale database where I will be recording trades on multiple stocks. For each stock I will be saving the following columns: Trade time, Attribute 1, Attribute 2, ...
2 votes
0 answers
34 views

How do I know which timescale db docker image was used?

I see timescaledb.last_tuned_version = '0.8.0' in postgresql.conf. How can I know which docker timescaledb image (exact version) was used?
-1 votes
1 answer
208 views

TimescaleDB wildcard (%) slow

I have a timescaledb hypertable like this: create table logs ( time timestamp not null, partitionkey text not null, ip inet, raw text, transformed ...
4 votes
1 answer
519 views

Continuously Adding SSDs to an existing PostgreSQL Server

An Ubuntu 18.04 server dedicated to running a PostgreSQL 11.2 server (with TimescaleDB extension) will be running out of disk space soon so new SSD disks will need to be added to the machine to ...