Browse Source

[Improvement-16867] Add project_code index on t_ds_workflow_definition (#16869)

dev
xiangzihao 3 weeks ago committed by GitHub
parent
commit
117dde37b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql
  2. 2
      dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
  3. 3
      dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql
  4. 3
      dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql

6
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql

@ -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;
-- ----------------------------
@ -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;
-- ----------------------------

2
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql

@ -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
@ -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

3
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql

@ -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;

3
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql

@ -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);

Loading…
Cancel
Save