Browse Source

add index (#8500)

3.0.0/version-upgrade
xiangzihao 3 years ago committed by GitHub
parent
commit
512f8cb5dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql
  2. 2
      dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
  3. 2
      dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql
  4. 6
      dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql

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

@ -539,7 +539,9 @@ CREATE TABLE `t_ds_process_task_relation` (
`create_time` datetime NOT NULL COMMENT 'create time',
`update_time` datetime NOT NULL COMMENT 'update time',
PRIMARY KEY (`id`),
KEY `idx_code` (`project_code`,`process_definition_code`)
KEY `idx_code` (`project_code`,`process_definition_code`),
KEY `idx_pre_task_code_version` (`pre_task_code`,`pre_task_version`),
KEY `idx_post_task_code_version` (`post_task_code`,`post_task_version`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------

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

@ -462,6 +462,8 @@ CREATE TABLE t_ds_process_task_relation (
) ;
create index process_task_relation_idx_project_code_process_definition_code on t_ds_process_task_relation (project_code,process_definition_code);
create index process_task_relation_idx_pre_task_code_version on t_ds_process_task_relation (pre_task_code, pre_task_version);
create index process_task_relation_idx_post_task_code_version on t_ds_process_task_relation (post_task_code, post_task_version);
--
-- Table structure for table t_ds_process_task_relation_log

2
dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql

@ -18,6 +18,8 @@
ALTER TABLE `t_ds_task_instance` ADD INDEX `idx_code_version` (`task_code`, `task_definition_version`) USING BTREE;
ALTER TABLE `t_ds_task_instance` MODIFY COLUMN `task_params` longtext COMMENT 'job custom parameters' AFTER `app_link`;
ALTER TABLE `t_ds_process_task_relation` ADD KEY `idx_code` (`project_code`, `process_definition_code`) USING BTREE;
ALTER TABLE `t_ds_process_task_relation` ADD KEY `idx_pre_task_code_version` (`pre_task_code`,`pre_task_version`);
ALTER TABLE `t_ds_process_task_relation` ADD KEY `idx_post_task_code_version` (`post_task_code`,`post_task_version`);
ALTER TABLE `t_ds_process_task_relation_log` ADD KEY `idx_process_code_version` (`process_definition_code`,`process_definition_version`) USING BTREE;
ALTER TABLE `t_ds_task_definition_log` ADD INDEX `idx_project_code` (`project_code`) USING BTREE;

6
dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql

@ -32,6 +32,12 @@ BEGIN
EXECUTE 'DROP INDEX IF EXISTS "process_task_relation_idx_project_code_process_definition_code"';
EXECUTE 'CREATE INDEX IF NOT EXISTS process_task_relation_idx_project_code_process_definition_code ON ' || quote_ident(v_schema) ||'.t_ds_process_task_relation USING Btree("project_code","process_definition_code")';
EXECUTE 'DROP INDEX IF EXISTS "process_task_relation_idx_pre_task_code_version"';
EXECUTE 'CREATE INDEX IF NOT EXISTS process_task_relation_idx_pre_task_code_version ON ' || quote_ident(v_schema) ||'.t_ds_process_task_relation USING Btree("pre_task_code","pre_task_version")';
EXECUTE 'DROP INDEX IF EXISTS "process_task_relation_idx_post_task_code_version"';
EXECUTE 'CREATE INDEX IF NOT EXISTS process_task_relation_idx_post_task_code_version ON ' || quote_ident(v_schema) ||'.t_ds_process_task_relation USING Btree("post_task_code","post_task_version")';
EXECUTE 'DROP INDEX IF EXISTS "process_task_relation_log_idx_project_code_process_definition_code"';
EXECUTE 'CREATE INDEX IF NOT EXISTS process_task_relation_log_idx_project_code_process_definition_code ON ' || quote_ident(v_schema) ||'.t_ds_process_task_relation_log USING Btree("project_code","process_definition_code")';

Loading…
Cancel
Save