Change indexes on Op History table 32/121532/3
authorJim Hahn <jrh3@att.com>
Tue, 25 May 2021 13:06:50 +0000 (09:06 -0400)
committerJim Hahn <jrh3@att.com>
Tue, 25 May 2021 18:30:48 +0000 (14:30 -0400)
This is the companion change to that made in policy-models.
Per review comments:
- added index to s3p sql script

Issue-ID: POLICY-2874
Change-Id: Ic270b8da92be8b921b3a865ff1ce923af21faaab
Signed-off-by: Jim Hahn <jrh3@att.com>
packages/policy-xacmlpdp-tarball/src/main/resources/mysql/sql/createguardtable.sql
testsuites/guard-testing-utils/mysql/sql/testguard.sql

index f2d01fb..aea02f7 100644 (file)
@@ -1,5 +1,5 @@
 -- ============LICENSE_START=======================================================
--- Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+-- Copyright (C) 2019-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.
@@ -32,7 +32,7 @@ create table if not exists operationshistory (
 );
 
 create index if not exists operationshistory_clreqid_index on
-    operationshistory(closedLoopName, requestId);
+    operationshistory(requestId, closedLoopName);
 
 create index if not exists operationshistory_target_index on
-    operationshistory(target, operation, actor);
+    operationshistory(target, operation, actor, endtime);
index 15ec576..3840b43 100644 (file)
@@ -15,5 +15,11 @@ create table if not exists operationshistory (
     PRIMARY KEY (id)
 );
 
+create index if not exists operationshistory_clreqid_index on
+    operationshistory(requestId, closedLoopName);
+
+create index if not exists operationshistory_target_index on
+    operationshistory(target, operation, actor, endtime);
+
 insert into operationshistory (`closedLoopName`,`requestId`,`actor`,`operation`,`target`,`starttime`,`outcome`,`message`,`subrequestId`,`endtime`)
 VALUES('ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3','test001122','SO','VF Module Create','.*',NOW() - INTERVAL 1 HOUR,'SUCCESS',null,null,Now());