diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-11-02 07:50:52 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-11-02 07:50:52 +0100 |
commit | d370ff3d3dff3cc59d092ce2eb48edd5ae8198df (patch) | |
tree | 51bb47a1e1706f7747df5f3a424c037321ec6c9e /sonar-core | |
parent | 75d94af97eec8d3f4f68b3535ffd3365456e490f (diff) | |
download | sonarqube-d370ff3d3dff3cc59d092ce2eb48edd5ae8198df.tar.gz sonarqube-d370ff3d3dff3cc59d092ce2eb48edd5ae8198df.zip |
SONAR-2962 Add an index on dependencies.project_snapshot_id to improve performance
Diffstat (limited to 'sonar-core')
3 files changed, 4 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java index a645d78d5c8..2184d19b05b 100644 --- a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java +++ b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java @@ -42,7 +42,7 @@ public class SchemaMigration { - complete the Derby DDL file used for unit tests : sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl */ - public static final int LAST_VERSION = 221; + public static final int LAST_VERSION = 222; public final static String TABLE_NAME = "schema_migrations"; diff --git a/sonar-core/src/main/resources/org/sonar/persistence/rows-derby.sql b/sonar-core/src/main/resources/org/sonar/persistence/rows-derby.sql index 9970b86ccba..66adfa97455 100644 --- a/sonar-core/src/main/resources/org/sonar/persistence/rows-derby.sql +++ b/sonar-core/src/main/resources/org/sonar/persistence/rows-derby.sql @@ -163,6 +163,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('216'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('217'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('220'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('221'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('222'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-core/src/main/resources/org/sonar/persistence/schema-derby.ddl b/sonar-core/src/main/resources/org/sonar/persistence/schema-derby.ddl index cc8a7e40f3e..5a3672b6dd1 100644 --- a/sonar-core/src/main/resources/org/sonar/persistence/schema-derby.ddl +++ b/sonar-core/src/main/resources/org/sonar/persistence/schema-derby.ddl @@ -119,6 +119,8 @@ CREATE INDEX "DEPS_TO_SID" ON "DEPENDENCIES" ("TO_SNAPSHOT_ID"); CREATE INDEX "DEPS_FROM_SID" ON "DEPENDENCIES" ("FROM_SNAPSHOT_ID"); +CREATE INDEX "DEPS_PRJ_SID" ON "DEPENDENCIES" ("PROJECT_SNAPSHOT_ID"); + CREATE INDEX "MEASURES_SID_METRIC" ON "PROJECT_MEASURES" ("SNAPSHOT_ID", "METRIC_ID"); CREATE INDEX "ACTIVE_RULE_CHANGES_PID" ON "ACTIVE_RULE_CHANGES" ("PROFILE_ID"); |