From e154c687e6f1dd7f4dad0553c801542980209fcb Mon Sep 17 00:00:00 2001 From: Charitha Goonetilleke Date: Thu, 16 May 2024 12:29:40 +0530 Subject: [PATCH] Add additional indexes to DM_DB --- .../src/main/resources/dbscripts/cdm/mysql.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql index 70005138334..cd28fb74f10 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -63,6 +63,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE ( CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID); CREATE INDEX IDX_DM_DEVICE_TYPE_ID_DEVICE_IDENTIFICATION ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID,DEVICE_IDENTIFICATION); +CREATE INDEX IDX_DM_DEVICE_DEVICE_IDENTIFICATION ON DM_DEVICE(DEVICE_IDENTIFICATION); +CREATE INDEX IDX_DM_DEVICE_LAST_UPDATED_TIMESTAMP ON DM_DEVICE(LAST_UPDATED_TIMESTAMP); CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES ( DEVICE_TYPE_NAME VARCHAR(300) NOT NULL, @@ -132,10 +134,13 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT ( CONSTRAINT FK_DM_DEVICE_ENROLMENT FOREIGN KEY (DEVICE_ID) REFERENCES DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION )ENGINE = InnoDB; -CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID); -CREATE INDEX IDX_ENROLMENT_DEVICE_TYPE ON DM_ENROLMENT(DEVICE_TYPE); +CREATE INDEX IDX_ENROLMENT_DATE_OF_LAST_UPDATE ON DM_ENROLMENT(DATE_OF_LAST_UPDATE); CREATE INDEX IDX_ENROLMENT_DEVICE_IDENTIFICATION ON DM_ENROLMENT(DEVICE_IDENTIFICATION); +CREATE INDEX IDX_ENROLMENT_DEVICE_TYPE ON DM_ENROLMENT(DEVICE_TYPE); +CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID); CREATE INDEX IDX_ENROLMENT_STATUS ON DM_ENROLMENT(STATUS); +CREATE INDEX IDX_ENROLMENT_TENANT_ID ON DM_ENROLMENT(TENANT_ID); + CREATE TABLE IF NOT EXISTS DM_DEVICE_STATUS ( ID INTEGER AUTO_INCREMENT NOT NULL,