mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
refactor(接口测试): 增加接口和场景的索引
--bug=1025028 --user=王孝刚 【接口测试】场景-删除模块-模块下只有一个场景-耗时20秒左右 https://www.tapd.cn/55049933/s/1358738
This commit is contained in:
parent
60cf19b2f9
commit
47a796f296
@ -0,0 +1,17 @@
|
||||
SET SESSION innodb_lock_wait_timeout = 7200;
|
||||
|
||||
--
|
||||
-- 增加一个索引
|
||||
SELECT IF(EXISTS(SELECT DISTINCT index_name
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'api_scenario'
|
||||
AND index_name LIKE 'api_scenario_module_id_index'),
|
||||
'select 1',
|
||||
'ALTER TABLE api_scenario ADD INDEX api_scenario_module_id_index (api_scenario_module_id)')
|
||||
INTO @a;
|
||||
PREPARE moduleId FROM @a;
|
||||
EXECUTE moduleId;
|
||||
DEALLOCATE PREPARE moduleId;
|
||||
|
||||
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
@ -0,0 +1,17 @@
|
||||
SET SESSION innodb_lock_wait_timeout = 7200;
|
||||
|
||||
--
|
||||
-- 增加一个索引
|
||||
SELECT IF(EXISTS(SELECT DISTINCT index_name
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'api_definition'
|
||||
AND index_name LIKE 'api_definition_protocol_index'),
|
||||
'select 1',
|
||||
'ALTER TABLE api_definition ADD INDEX api_definition_protocol_index (protocol)')
|
||||
INTO @a;
|
||||
PREPARE protocol FROM @a;
|
||||
EXECUTE protocol;
|
||||
DEALLOCATE PREPARE protocol;
|
||||
|
||||
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
@ -0,0 +1,17 @@
|
||||
SET SESSION innodb_lock_wait_timeout = 7200;
|
||||
|
||||
--
|
||||
-- 增加一个索引
|
||||
SELECT IF(EXISTS(SELECT DISTINCT index_name
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'api_test_case'
|
||||
AND index_name LIKE 'api_test_case_project_id_index'),
|
||||
'select 1',
|
||||
'ALTER TABLE api_test_case ADD INDEX api_test_case_project_id_index (project_id)')
|
||||
INTO @a;
|
||||
PREPARE projectId FROM @a;
|
||||
EXECUTE projectId;
|
||||
DEALLOCATE PREPARE projectId;
|
||||
|
||||
SET SESSION innodb_lock_wait_timeout = DEFAULT;
|
Loading…
Reference in New Issue
Block a user