I have this MySQL table, with 120M rows and a size of about 120GB:
CREATE TABLE `impressions` (
`session_uuid` varchar(36) DEFAULT NULL,
`survey_uuid` varchar(255) NOT NULL,
`data` text,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`user_uuid` varchar(255) NOT NULL DEFAULT '',
`is_test` tinyint(1) NOT NULL DEFAULT '0',
KEY `impressions_survey_uuid_session_uuid_user_uuid_index` (`survey_uuid`,`session_uuid`,`user_uuid`),
KEY `impressions_created_at_index` (`created_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
I see that this data migration is taking more than 6 hours (on a decent RDS instance where I was able to run more complex migrations) because is doing lots of I/O operations. Why does it have to do so many operations? The only thing I'm changing here is the NULL optionality and the default value.
ALTER TABLE `impressions` CHANGE COLUMN `user_uuid` `user_uuid` VARCHAR(255) null;