We're running Zabbix 7.0.3 with Postgres 14 and Timescale 2.16. It's been running for a couple of years, with upgrades and migrations along the way.
We never upgraded to using primary keys for the history tables, but I really want to. Our compressed DB is 111 GB so running the scripts, which dump the tables to .csv files, create temp table, import data from csv file and finally INSERT .. SELECT from temp table will take *a long* time.
My question is, is there a reason why the migration script doesn't just create the new table and INSERT .. SELECT from the old table? Why the \copy to and from file?
We never upgraded to using primary keys for the history tables, but I really want to. Our compressed DB is 111 GB so running the scripts, which dump the tables to .csv files, create temp table, import data from csv file and finally INSERT .. SELECT from temp table will take *a long* time.
My question is, is there a reason why the migration script doesn't just create the new table and INSERT .. SELECT from the old table? Why the \copy to and from file?
Comment