-------------- SELECT version() -------------- +-----------------------+ | version() | +-----------------------+ | 10.4.26-MariaDB-debug | +-----------------------+ -------------- 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.07202433 | alter table a2 modify if exists output json | | 2 | 0.01832570 | 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.00471766 | alter table a2 modify if exists output longtext DEFAULT NULL CHECK (json_valid(output)) | | 4 | 0.01531596 | 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.000050 | | Checking permissions | 0.000009 | | Init for update | 0.000006 | | Opening tables | 0.000032 | | After opening tables | 0.000015 | | Setup | 0.000040 | | Creating table | 0.000070 | | After create | 0.000016 | | Opening tables | 0.000014 | | After opening tables | 0.000007 | | System lock | 0.000007 | | Table lock | 0.000013 | | Closing tables | 0.000006 | | Unlocking tables | 0.000008 | | Closing tables | 0.001726 | | System lock | 0.000009 | | Table lock | 0.000005 | | Closing tables | 0.031783 | | Copy to tmp table | 0.000032 | | Copy to tmp table | 0.000063 | | Enabling keys | 0.000050 | | Rename result table | 0.000090 | | Unlocking tables | 0.000007 | | Rename result table | 0.037850 | | End of update loop | 0.000013 | | Query end | 0.000009 | | Commit | 0.000006 | | Closing tables | 0.000006 | | Unlocking tables | 0.000006 | | Closing tables | 0.000006 | | Commit_implicit | 0.000016 | | Starting cleanup | 0.000006 | | Freeing items | 0.000010 | | Updating status | 0.000012 | | Reset for next command | 0.000025 | +------------------------+----------+ -------------- SHOW PROFILE FOR QUERY 3 -------------- +--------------------------------+----------+ | Status | Duration | +--------------------------------+----------+ | Starting | 0.000043 | | Checking permissions | 0.000008 | | Init for update | 0.000006 | | Opening tables | 0.000017 | | After opening tables | 0.000013 | | Setup | 0.000031 | | Creating table | 0.000081 | | After create | 0.001748 | | System lock | 0.000008 | | Table lock | 0.000005 | | After create | 0.000005 | | Preparing for alter table | 0.000034 | | Altering table | 0.000013 | | Committing alter table to stor | 0.001995 | | Unlocking tables | 0.000010 | | Committing alter table to stor | 0.000604 | | End of update loop | 0.000009 | | Query end | 0.000006 | | Commit | 0.000010 | | Closing tables | 0.000006 | | Unlocking tables | 0.000005 | | Closing tables | 0.000005 | | Commit_implicit | 0.000007 | | Starting cleanup | 0.000006 | | Freeing items | 0.000008 | | Updating status | 0.000010 | | Reset for next command | 0.000024 | +--------------------------------+----------+