REG_LOG table contains all the registry operations performed for all the registry resources in the system. When you clean up this table, you need to keep the latest record from every resource path to maintain atleast one resource reference in case of reindexing. Exceute the following query to clean this table.
DELETECREATE n1 FROM TABLE reg_log_ids_to_KEEP ( REG_LOG_ID n1INTEGER, REG_LOGTENANT_ID n2INTEGER WHERE n1.); INSERT INTO reg_log_ids_to_KEEP (REG_LOG_ID, < n2.REG_LOGTENANT_ID) AND n1. SELECT MAX(REG_PATH = n2.REG_PATH AND n1.LOG_ID) AS REG_LOG_ID, REG_TENANT_ID =FROM n2.REG_LOG GROUP BY REG_PATH, REG_TENANT_ID; DELETE FROM REG_LOG WHEREwhere REG_ACTIONLOG_ID = 7; CREATE INDEX REG_RESOURCE_IND_BY_UUID USING HASH ON REG_RESOURCE(REG_UUID)not in (SELECT REG_LOG_ID from reg_log_ids_to_KEEP); drop table reg_log_ids_to_KEEP; DELETE FROM REG_LOG WHERE REG_ACTION = 7;
Cleaning up the REG_LOG table periodically might be required if there is a large amount of data in the table, and as a result it takes a long time to process queries. Executing the query given above helps to improve the performance of the database.