Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-06-22 17:51:36 +0000
committerDonald Dunne2017-06-28 16:59:04 +0000
commit9f07f87be4ad05e6e79f89ad17accc3371518293 (patch)
tree3f93d53b898ae801385f82eb8faa94cbb5689ca1
parent1f3f07d44281549f9a36a60bcf29357306194ebb (diff)
downloadorg.eclipse.osee-9f07f87be4ad05e6e79f89ad17accc3371518293.tar.gz
org.eclipse.osee-9f07f87be4ad05e6e79f89ad17accc3371518293.tar.xz
org.eclipse.osee-9f07f87be4ad05e6e79f89ad17accc3371518293.zip
bug[ats_ATS416136]: Improve performance of RelatedTo query
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/RelatedToSqlHandler.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerPriority.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
index 36f244e6c1..7e91e4c7ce 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerFactoryUtilTest.java
@@ -90,6 +90,7 @@ public class SqlHandlerFactoryUtilTest {
Iterator<SqlHandler<?>> iterator = handlers.iterator();
assertHandler(iterator.next(), ArtifactIdsSqlHandler.class, SqlHandlerPriority.ARTIFACT_ID);
assertHandler(iterator.next(), ArtifactGuidSqlHandler.class, SqlHandlerPriority.ARTIFACT_GUID);
+ assertHandler(iterator.next(), RelatedToSqlHandler.class, SqlHandlerPriority.RELATED_TO_ART_IDS);
assertHandler(iterator.next(), AttributeOtherSqlHandler.class, SqlHandlerPriority.ATTRIBUTE_VALUE);
assertHandler(iterator.next(), AttributeTokenSqlHandler.class, SqlHandlerPriority.ATTRIBUTE_TOKENIZED_VALUE,
@@ -99,7 +100,6 @@ public class SqlHandlerFactoryUtilTest {
assertHandler(iterator.next(), AttributeTypeNotExistsSqlHandler.class,
SqlHandlerPriority.ATTRIBUTE_TYPE_NOT_EXISTS);
assertHandler(iterator.next(), RelationTypeExistsSqlHandler.class, SqlHandlerPriority.RELATION_TYPE_EXISTS);
- assertHandler(iterator.next(), RelatedToSqlHandler.class, SqlHandlerPriority.RELATED_TO_ART_IDS);
assertHandler(iterator.next(), AllArtifactsSqlHandler.class, SqlHandlerPriority.ALL_ARTIFACTS);
assertHandler(iterator.next(), RelationTypeFollowSqlHandler.class, SqlHandlerPriority.FOLLOW_RELATION_TYPES);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/RelatedToSqlHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/RelatedToSqlHandler.java
index 15a9d54aa9..52e6f279a4 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/RelatedToSqlHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/RelatedToSqlHandler.java
@@ -89,14 +89,14 @@ public class RelatedToSqlHandler extends SqlHandler<CriteriaRelatedTo> {
if (criteria.hasMultipleIds()) {
jIdAlias = writer.addTable(TableEnum.ID_JOIN_TABLE);
}
+ relAlias = writer.addTable(TableEnum.RELATION_TABLE);
+ txsAlias = writer.addTable(TableEnum.TXS_TABLE, ObjectType.RELATION);
List<String> artAliases = writer.getAliases(TableEnum.ARTIFACT_TABLE);
if (artAliases.isEmpty()) {
artAlias = writer.addTable(TableEnum.ARTIFACT_TABLE);
artTxsAlias = writer.addTable(TableEnum.TXS_TABLE, ObjectType.ARTIFACT);
}
- relAlias = writer.addTable(TableEnum.RELATION_TABLE);
- txsAlias = writer.addTable(TableEnum.TXS_TABLE, ObjectType.RELATION);
}
private String getPredicate(AbstractSqlWriter writer, String txsAliasName, String relAliasName) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerPriority.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerPriority.java
index b85994cfcb..866b4eb26c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerPriority.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/handlers/SqlHandlerPriority.java
@@ -35,6 +35,7 @@ public enum SqlHandlerPriority {
//
ARTIFACT_ID,
ARTIFACT_GUID,
+ RELATED_TO_ART_IDS,
ATTRIBUTE_VALUE,
ATTRIBUTE_TOKENIZED_VALUE,
ARTIFACT_TYPE,
@@ -45,7 +46,6 @@ public enum SqlHandlerPriority {
ATTRIBUTE_TX_DATA_XTRA,
RELATION_TYPE_EXISTS,
- RELATED_TO_ART_IDS,
ALL_ARTIFACTS,
ARTIFACT_TX_DATA_XTRA,

Back to the top