-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
6.2.6
-
Linux
tsdb_history_pk_upgrade_*_compression scripts have:
\copy (select * from history_old) TO '/tmp/history.csv' DELIMITER ',' CSV;
and
\copy temp_history FROM '/tmp/history.csv' DELIMITER ',' CSV
A much better way to do it is:
\copy (select * from history_old) TO PROGRAM 'gzip > /tmp/history.csv' DELIMITER ',' CSV;
and
\copy temp_history FROM PROGRAM 'zcat /tmp/history.csv' DELIMITER ',' CSV
It's much faster, doesn't run the disk out of space, and just better all the way around so I offer it has suggestion to improve the software.