From dd9ad9bb3a6f4c8b86f83177bc2a743e3f504a4f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 8 Mar 2016 15:05:06 +0100 Subject: [PATCH] SONAR-7379 Drop inefficient index ISSUES_SEVERITY --- .../1114_remove_issues_status_index.rb | 2 +- .../1115_remove_issues_severity_index.rb | 32 +++++++++++++++++++ .../org/sonar/db/version/DatabaseVersion.java | 2 +- .../org/sonar/db/version/rows-h2.sql | 1 + .../org/sonar/db/version/schema-h2.ddl | 2 -- 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1115_remove_issues_severity_index.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1114_remove_issues_status_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1114_remove_issues_status_index.rb index 547dc7e3754..fc8b187b035 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1114_remove_issues_status_index.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1114_remove_issues_status_index.rb @@ -22,7 +22,7 @@ # SonarQube 5.5 # SONAR-7378 # -class RemoveIssueStatusIndex < ActiveRecord::Migration +class RemoveIssuesStatusIndex < ActiveRecord::Migration def self.up remove_index :issues, :name => 'issues_status' diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1115_remove_issues_severity_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1115_remove_issues_severity_index.rb new file mode 100644 index 00000000000..834baabdd59 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1115_remove_issues_severity_index.rb @@ -0,0 +1,32 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# SonarQube is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# SonarQube 5.5 +# SONAR-7379 +# +class RemoveIssuesSeverityIndex < ActiveRecord::Migration + + def self.up + remove_index :issues, :name => 'issues_severity' + end + +end + diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java index 67b823778ac..b0c7ac94eb8 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java +++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java @@ -29,7 +29,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 1114; + public static final int LAST_VERSION = 1115; /** * The minimum supported version which can be upgraded. Lower diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index 76ad5e03d09..f44bf0fccd1 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -392,6 +392,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1111'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1112'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1113'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1114'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1115'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl index e6116e12792..af42d8ac7a3 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl +++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl @@ -637,8 +637,6 @@ CREATE INDEX "ISSUES_PROJECT_UUID" ON "ISSUES" ("PROJECT_UUID"); CREATE INDEX "ISSUES_RULE_ID" ON "ISSUES" ("RULE_ID"); -CREATE INDEX "ISSUES_SEVERITY" ON "ISSUES" ("SEVERITY"); - CREATE INDEX "ISSUES_RESOLUTION" ON "ISSUES" ("RESOLUTION"); CREATE INDEX "ISSUES_ASSIGNEE" ON "ISSUES" ("ASSIGNEE"); -- 2.39.5