summaryrefslogtreecommitdiffstats
path: root/models-interactions
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-05-24 11:39:42 -0400
committerJim Hahn <jrh3@att.com>2021-05-24 11:42:38 -0400
commit3031446fc890ac27d837df7b9e6b3d385de0fd43 (patch)
tree99e1dc45e4543c799185b079dbd021e5679a7f92 /models-interactions
parentd00c73842c6f8e7bb00b29d2fb5dd63b9cde4bfe (diff)
Adjust indexes for Op History table
Reordered one index to put requestId first, as that should significantly reduce the number of index entries to be examined. Added endtime to another index, which should also reduce the number of index entries to be examined for look-ups by time. Issue-ID: POLICY-2874 Change-Id: I29c10fb9cabb22b3520ed1b14d7fe3fd9db40a15 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions')
-rw-r--r--models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java b/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java
index 7354fff5d..0e66217f4 100644
--- a/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java
+++ b/models-interactions/model-impl/guard/src/main/java/org/onap/policy/guard/OperationsHistory.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@ import javax.persistence.Table;
import lombok.Data;
@Entity
-@Table(name = "operationshistory",
- indexes = {@Index(name = "operationshistory_clreqid_index", columnList = "closedLoopName,requestId"),
- @Index(name = "operationshistory_target_index", columnList = "target,operation,actor")})
+@Table(name = "operationshistory", indexes = {
+ @Index(name = "operationshistory_clreqid_index", columnList = "requestId,closedLoopName"),
+ @Index(name = "operationshistory_target_index", columnList = "target,operation,actor,endtime")})
@Data
public class OperationsHistory implements Serializable {