All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed the reg_log clean up script DOCUMENTATION-8205

...

The 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.

Code Block
DELETE n1 FROMCREATE TABLE reg_log_ids_to_KEEP (
             REG_LOG_ID n1, INTEGER,
             REG_TENANT_ID INTEGER
);

INSERT INTO reg_log_ids_to_KEEP (REG_LOG n2 WHERE n1._ID, REG_TENANT_ID) 
SELECT MAX(REG_LOG_ID) <AS n2.REG_LOG_ID, AND n1.REG_PATHTENANT_ID =FROM n2.REG_PATHLOG GROUP ANDBY n1.REG_TENANT_ID = n2.PATH, REG_TENANT_ID;

DELETE FROM REG_LOG WHERE where REG_LOG_ID not in (SELECT REG_LOG_ACTIONID = 7from reg_log_ids_to_KEEP);
CREATEdrop INDEXtable REGreg_RESOURCElog_INDids_BYto_UUIDKEEP;
USING
HASHDELETE ONFROM REG_RESOURCE(LOG WHERE REG_UUID)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. 

...