PGDay France 2024
Julien RIOU
12 Juin 2024
LOG: checkpoints are occurring too frequently (9 seconds apart)
HINT: Consider increasing the configuration parameter "max_wal_size".
Pics de lignes supprimées par seconde
SELECT create_hypertable('history', 'clock', chunk_time_interval => 86400, migrate_data => true);
SELECT create_hypertable('history_uint', 'clock', chunk_time_interval => 86400, migrate_data => true);
SELECT create_hypertable('history_log', 'clock', chunk_time_interval => 86400, migrate_data => true);
SELECT create_hypertable('history_text', 'clock', chunk_time_interval => 86400, migrate_data => true);
SELECT create_hypertable('history_str', 'clock', chunk_time_interval => 86400, migrate_data => true);
SELECT create_hypertable('trends', 'clock', chunk_time_interval => 2592000, migrate_data => true);
SELECT create_hypertable('trends_uint', 'clock', chunk_time_interval => 2592000, migrate_data => true);
BEGIN;
UPDATE config SET db_extension='timescaledb',hk_history_global=1,hk_trends_global=1;
UPDATE config SET compression_status=1,compress_older='7d';
COMMIT;
Option migrate_data
viable pour les petites bases (<50GB).
clock
CREATE SEQUENCE rated_element_id_seq;
ALTER TABLE rated_element
ADD COLUMN id BIGINT NOT NULL DEFAULT NEXTVAL('rated_element_id_seq');
Pour chaque chunk :
COPY
S’il-vous-plait, évitez.
🙏