Applies to:
All versions of PcVue that include the Historical Data Server |
||
|
||
Summary:
Technical information about the two purge mechanisms used by the HDS to control the size of an SQL Server Database. |
||
|
||
Details:
The Contingent Purge (or emergency purge as it is sometimes called) The contingent purge is used to automatically delete a percentage of the oldest records before a database reaches the maximum size. It is optimized for speed and during the cycle the system will become very busy and access to the database may be blocked. The contigent purge uses an SQL Query with the following structure. DELETE FROM [TABLE_NAME] WHERE [chrono] IN (SELECT TOP XX PERCENT [chrono] FROM [TABLE_NAME] ORDER BY [chrono] ASC) XX is the value of the Data volume to purge property. The query is triggered when the Start purge if database size is greater than value is reached. The Contingent Purge does not consume memory in the HDS. The Maintenance Plan Purge Task The Purge Task limits the size of the database by deleting older records. It runs according to the Maintenance Plan schedule. The Purge Task uses an SQL Query with the following structure. SELECT TOP YYYYY [chrono] FROM [TABLE_NAME] WHERE (chrono < CHRONO_VALUE) Where YYYYY is the MaxPurgedRecords setting in the HDSCONF.DAT file. The Purge Task is optimised not to block access to the SQL Server by PcVue. The query will be repeated approximately once a second until the Time Limit age of records, configured in the Purge Task dialog, is acheived. The Purge Task can consume considerable memory in the HDS as each of the records are saved in a recordset before they are finally deleted in one action. You can reduce the memory used by changing the value of MaxPurgedRecords but this must be balanced against the time taken to complete the task. If MaxPurgedRecords is set to 0 a different query is used. DELETE FROM [TABLE_NAME] WHERE (chrono < CHRONO_VALUE) This deletes records in one operation similar to a Contingent Purge and with similar effects on the operation of PcVue. |
||
|
||
|
Created on: 04 Oct 2016 Last update: 16 May 2024