From d2dee96d90b8b376e6d37b3d49e1ea80e6420a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Sun, 24 Nov 2019 15:44:33 +0100 Subject: [PATCH] Modified chunksize 2GB -> 6 hours --- app/commands/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commands/database.py b/app/commands/database.py index 05fd4e5..9f1c550 100644 --- a/app/commands/database.py +++ b/app/commands/database.py @@ -60,8 +60,8 @@ def init_timescaledb(): """Initialize TimescaleDB features.""" db.session.execute("CREATE EXTENSION IF NOT EXISTS timescaledb;") - db.session.execute("SELECT create_hypertable('aircraft_beacons', 'timestamp', chunk_target_size => '2GB', if_not_exists => TRUE);") - db.session.execute("SELECT create_hypertable('receiver_beacons', 'timestamp', chunk_target_size => '2GB', if_not_exists => TRUE);") + db.session.execute("SELECT create_hypertable('aircraft_beacons', 'timestamp', chunk_time_interval => interval '6 hours', if_not_exists => TRUE);") + db.session.execute("SELECT create_hypertable('receiver_beacons', 'timestamp', chunk_time_interval => interval '6 hours', if_not_exists => TRUE);") db.session.commit() print("Done.")