From 38260a5df1557e9973316d57a6e7a89d376c0a09 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 24 Feb 2022 16:47:27 +0100 Subject: [PATCH] mysql: Remove unused job attributes The columns were included to support job restarts. However, that has never been implemented. So remove the unused columns. Note: This change reduced the size of our mxq_job.ibd with 35824930 rows from 32GB to 24GB which is more than I've expected. --- mysql/create_tables.sql | 4 ---- mysql/migrate_014_remove_job_id_fields.sql | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 mysql/migrate_014_remove_job_id_fields.sql diff --git a/mysql/create_tables.sql b/mysql/create_tables.sql index 3ff573f8..549b55a7 100644 --- a/mysql/create_tables.sql +++ b/mysql/create_tables.sql @@ -102,10 +102,6 @@ CREATE TABLE IF NOT EXISTS mxq_job ( date_start TIMESTAMP NOT NULL DEFAULT 0, date_end TIMESTAMP NOT NULL DEFAULT 0, - job_id_new INT8 UNSIGNED NULL DEFAULT NULL, - job_id_old INT8 UNSIGNED NULL DEFAULT NULL, - job_id_first INT8 UNSIGNED NULL DEFAULT NULL, - stats_max_sumrss INT8 UNSIGNED NOT NULL DEFAULT 0, stats_status INT4 UNSIGNED NOT NULL DEFAULT 0, diff --git a/mysql/migrate_014_remove_job_id_fields.sql b/mysql/migrate_014_remove_job_id_fields.sql new file mode 100644 index 00000000..e01a96bd --- /dev/null +++ b/mysql/migrate_014_remove_job_id_fields.sql @@ -0,0 +1,4 @@ +ALTER TABLE mxq_job + DROP COLUMN job_id_new, + DROP COLUMN job_id_old, + DROP COLUMN job_id_first;