-------------- SELECT version() -------------- +---------------------------+ | version() | +---------------------------+ | 10.5.17-MariaDB-debug-log | +---------------------------+ -------------- CREATE OR REPLACE TABLE `a2` ( `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `df__acl_tag` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `df__data` mediumblob NOT NULL, `version` bigint(20) DEFAULT NULL, `org_id` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `deployment_id` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `progress` decimal(20,9) DEFAULT NULL, `errors` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`errors`)), `activity_type_id` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `activity_type_name` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `activity_type_version` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `activity_type_namespace` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `activity_type_key` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`payload`)), `state` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created.user_name` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created.client_id` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created.time` bigint(20) unsigned DEFAULT NULL, `updated.user_name` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated.client_id` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `updated.time` bigint(20) unsigned DEFAULT NULL, `transitions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`transitions`)), `provider` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `submit_on_demand` tinyint(1) DEFAULT NULL, `error` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`error`)), `output` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`output`)), PRIMARY KEY (`id`), KEY `IX_activity_type_key_activity` (`activity_type_key`), KEY `IX_state_activity` (`state`), KEY `IX_org_id_activity` (`org_id`), KEY `CIX_org_id_activity_type_key` (`org_id`,`activity_type_key`), KEY `CIX_org_id_state` (`org_id`,`state`), KEY `CIX_state_updated_time` (`state`,`updated.time`), KEY `IX_provider_activity` (`provider`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci -------------- -------------- SELECT COLUMN_TYPE, COLLATION_NAME, IS_NULLABLE, CHECK_CLAUSE FROM INFORMATION_SCHEMA.COLUMNS t1 LEFT OUTER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS t2 USING (TABLE_NAME) WHERE t1.table_name='a2' AND t1.COLUMN_NAME='output' AND t2.table_name='a2' AND t2.CONSTRAINT_NAME='output' -------------- +-------------+----------------+-------------+----------------------+ | COLUMN_TYPE | COLLATION_NAME | IS_NULLABLE | CHECK_CLAUSE | +-------------+----------------+-------------+----------------------+ | longtext | utf8mb4_bin | YES | json_valid(`output`) | +-------------+----------------+-------------+----------------------+ -------------- SET profiling = 1 -------------- -------------- alter table a2 modify if exists output json -------------- -------------- SELECT COLUMN_TYPE, COLLATION_NAME, IS_NULLABLE, CHECK_CLAUSE FROM INFORMATION_SCHEMA.COLUMNS t1 LEFT OUTER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS t2 USING (TABLE_NAME) WHERE t1.table_name='a2' AND t1.COLUMN_NAME='output' AND t2.table_name='a2' AND t2.CONSTRAINT_NAME='output' -------------- +-------------+----------------+-------------+----------------------+ | COLUMN_TYPE | COLLATION_NAME | IS_NULLABLE | CHECK_CLAUSE | +-------------+----------------+-------------+----------------------+ | longtext | utf8mb4_bin | YES | json_valid(`output`) | +-------------+----------------+-------------+----------------------+ -------------- alter table a2 modify if exists output longtext DEFAULT NULL CHECK (json_valid(output)) -------------- -------------- SELECT COLUMN_TYPE, COLLATION_NAME, IS_NULLABLE, CHECK_CLAUSE FROM INFORMATION_SCHEMA.COLUMNS t1 LEFT OUTER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS t2 USING (TABLE_NAME) WHERE t1.table_name='a2' AND t1.COLUMN_NAME='output' AND t2.table_name='a2' AND t2.CONSTRAINT_NAME='output' -------------- +-------------+--------------------+-------------+----------------------+ | COLUMN_TYPE | COLLATION_NAME | IS_NULLABLE | CHECK_CLAUSE | +-------------+--------------------+-------------+----------------------+ | longtext | utf8mb4_unicode_ci | YES | json_valid(`output`) | +-------------+--------------------+-------------+----------------------+ -------------- SHOW PROFILES -------------- +----------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Query_ID | Duration | Query | +----------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 1 | 0.00269034 | alter table a2 modify if exists output json | | 2 | 0.02377820 | SELECT COLUMN_TYPE, COLLATION_NAME, IS_NULLABLE, CHECK_CLAUSE FROM INFORMATION_SCHEMA.COLUMNS t1 LEFT OUTER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS t2 USING (TABLE_NAME) WHERE t1.table_name='a2' AND t1.COLUMN_NAME='output' AND t2.table_name='a2' AND t2.CONSTRAINT_NAME='output' | | 3 | 0.06706441 | alter table a2 modify if exists output longtext DEFAULT NULL CHECK (json_valid(output)) | | 4 | 0.01955935 | SELECT COLUMN_TYPE, COLLATION_NAME, IS_NULLABLE, CHECK_CLAUSE FROM INFORMATION_SCHEMA.COLUMNS t1 LEFT OUTER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS t2 USING (TABLE_NAME) WHERE t1.table_name='a2' AND t1.COLUMN_NAME='output' AND t2.table_name='a2' AND t2.CONSTRAINT_NAME='output' | +----------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -------------- SHOW PROFILE FOR QUERY 1 -------------- +--------------------------------+----------+ | Status | Duration | +--------------------------------+----------+ | Starting | 0.000083 | | checking permissions | 0.000017 | | init for update | 0.000023 | | Opening tables | 0.000050 | | After opening tables | 0.000027 | | setup | 0.000064 | | creating table | 0.000134 | | After create | 0.001952 | | System lock | 0.000014 | | table lock | 0.000008 | | After create | 0.000008 | | preparing for alter table | 0.000022 | | altering table | 0.000020 | | Committing alter table to stor | 0.000015 | | Unlocking tables | 0.000009 | | Committing alter table to stor | 0.000113 | | End of update loop | 0.000015 | | Query end | 0.000010 | | Commit | 0.000018 | | closing tables | 0.000010 | | Unlocking tables | 0.000008 | | closing tables | 0.000008 | | Commit implicit | 0.000011 | | Starting cleanup | 0.000009 | | Freeing items | 0.000012 | | Updating status | 0.000017 | | Reset for next command | 0.000012 | +--------------------------------+----------+ -------------- SHOW PROFILE FOR QUERY 3 -------------- +------------------------+----------+ | Status | Duration | +------------------------+----------+ | Starting | 0.000075 | | checking permissions | 0.000009 | | init for update | 0.000007 | | Opening tables | 0.000029 | | After opening tables | 0.000015 | | setup | 0.000037 | | creating table | 0.000074 | | After create | 0.000018 | | Opening tables | 0.000013 | | After opening tables | 0.000007 | | System lock | 0.000006 | | table lock | 0.000012 | | Unlocking tables | 0.000009 | | closing tables | 0.003501 | | System lock | 0.000009 | | table lock | 0.000005 | | closing tables | 0.035552 | | copy to tmp table | 0.000122 | | Enabling keys | 0.000051 | | Rename result table | 0.000042 | | Unlocking tables | 0.000007 | | Rename result table | 0.027354 | | End of update loop | 0.000023 | | Query end | 0.000009 | | Commit | 0.000007 | | closing tables | 0.000007 | | Unlocking tables | 0.000006 | | closing tables | 0.000005 | | Commit implicit | 0.000008 | | Starting cleanup | 0.000006 | | Freeing items | 0.000014 | | Updating status | 0.000016 | | Reset for next command | 0.000009 | +------------------------+----------+