summaryrefslogtreecommitdiffstats
path: root/controlloop/common/database
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-05-21 17:47:18 -0400
committerJim Hahn <jrh3@att.com>2020-05-21 17:52:16 -0400
commit6dc566131200f634d54cc27712518bb163885cb0 (patch)
tree97653cba3df053bd48823d6aa7406b8e14037834 /controlloop/common/database
parent43bdc71a161c3c22b56c9eb801ed3c7771883077 (diff)
Add secondary indices to operationshistory table
Queries to the operationshistory table will degrade substantially as more records are added to the DB. The Dbao class should be moved to policy-models, but for now we'll just update it in both places (i.e., drools-apps and xacml-pdp). Issue-ID: POLICY-2581 Change-Id: Ic43cefdfd4d353b73d815bd629ef25f3d2b486c6 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/database')
-rw-r--r--controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/Dbao.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/Dbao.java b/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/Dbao.java
index e1c484650..ce0adb0c7 100644
--- a/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/Dbao.java
+++ b/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/Dbao.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -24,17 +24,18 @@ package org.onap.policy.database.operationshistory;
import java.io.Serializable;
import java.util.Date;
-
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
+import javax.persistence.Index;
import javax.persistence.Table;
-
import lombok.Data;
@Entity
-@Table(name = "operationshistory")
+@Table(name = "operationshistory",
+ indexes = {@Index(name = "operationshistory_clreqid_index", columnList = "closedLoopName,requestId"),
+ @Index(name = "operationshistory_target_index", columnList = "target,operation,actor")})
@Data
public class Dbao implements Serializable {