Skip to content

Commit

Permalink
[Improvement-16867] Add project_code index on t_ds_workflow_definition (
Browse files Browse the repository at this point in the history
  • Loading branch information
SbloodyS authored Dec 3, 2024
1 parent 7232a20 commit 117dde3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ CREATE TABLE `t_ds_workflow_definition` (
`create_time` datetime NOT NULL COMMENT 'create time',
`update_time` datetime NOT NULL COMMENT 'update time',
PRIMARY KEY (`id`,`code`),
UNIQUE KEY `workflow_unique` (`name`,`project_code`) USING BTREE
UNIQUE KEY `workflow_unique` (`name`,`project_code`) USING BTREE,
KEY `idx_project_code` (`project_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

-- ----------------------------
Expand All @@ -454,7 +455,8 @@ CREATE TABLE `t_ds_workflow_definition_log` (
`create_time` datetime NOT NULL COMMENT 'create time',
`update_time` datetime NOT NULL COMMENT 'update time',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_idx_code_version` (`code`,`version`) USING BTREE
UNIQUE KEY `uniq_idx_code_version` (`code`,`version`) USING BTREE,
KEY `idx_project_code` (`project_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

-- ----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ CREATE TABLE t_ds_workflow_definition (
) ;

create index workflow_definition_index on t_ds_workflow_definition (code,id);
create index workflow_definition_index_project_code on t_ds_workflow_definition (project_code);

--
-- Table structure for table t_ds_workflow_definition_log
Expand Down Expand Up @@ -379,6 +380,7 @@ CREATE TABLE t_ds_workflow_definition_log (
) ;

create UNIQUE index uniq_idx_code_version on t_ds_workflow_definition_log (code,version);
create index workflow_definition_log_index_project_code on t_ds_workflow_definition_log (project_code);

--
-- Table structure for table t_ds_task_definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@ d//
delimiter ;
CALL drop_data_quality_tables;
DROP PROCEDURE drop_data_quality_tables;

ALTER TABLE `t_ds_workflow_definition` ADD KEY `idx_project_code` (`project_code`) USING BTREE;
ALTER TABLE `t_ds_workflow_definition_log` ADD KEY `idx_project_code` (`project_code`) USING BTREE;
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@ d//

select drop_data_quality_tables();
DROP FUNCTION IF EXISTS drop_data_quality_tables();

create index workflow_definition_index_project_code on t_ds_workflow_definition (project_code);
create index workflow_definition_log_index_project_code on t_ds_workflow_definition_log (project_code);

0 comments on commit 117dde3

Please sign in to comment.