The D2000 Archive process maintains referential integrity between historical values not only at the object level (e.g., the primaryhistorical value H.Sec is used as a source for the statistical historical value H.Sec_Avg1min), but also at the item level of structured archives (e.g., the fifth row of the column historical value H.SV.Speed, which archives one column of the SV.Speed ​​structure, is used as a source for the statistical historical value H.SV.Speed_Avg1min).

Referential integrity at the item level of structured historical values is important for optimizing calculations. For example, after the user edits the historical value in the aforementioned fifth row of H.SV.Speed, the fifth row of H.SV.Speed_Avg1min will be automatically recalculated for the minute in which the changed value is located, but there is no reason to recalculate other rows of the structured archive H.SV.Speed_Avg1min. This is also the reason why expressions in calculated archives must contain a specific index, and a local variable cannot be used for indexing (unlike structured eval tags). To solve this scenario, the LOOP_TEMPLATE macro was implemented, which replaces the cycle (DO_LOOP), and D2000 Archive will expand it:

  • after the process starts
  • after saving the calculated historical value
  • after changing the size of the structured variable that is used in the calculated historical value

Recalculation of statistical and calculated historical values is performed as a result of:

  • A change in the value of the primary archive object that is used in a statistical or calculated historical value.
  • An explicit request for recalculation, which can be the RECALC command (entered by the user or using the COMMAND action) or the CALCONDEMANDSTAT action.

D2000 Archive automatically maintains the consistency of data of historical values with Calculation set to Continuous, but not if it is set to On Demand. In the CALCONDEMANDSTAT action, the parameter bCalcDepend=@False can be used to specify that dependent objects should not be recalculated; similarly, the RECALC command has the NODEPEND option with the same meaning.

If we recalculate multiple archive objects, the following optimizations occur in the calculation:

Optimization of one recalc

If the isochronous cache is enabled (the IsochronousCache archive parameter), calculations whose entire data interval is in the archive cache are optimized. If the RecalcOptimize parameter is enabled, data outside the isochronous cache is also optimized. Optimized recalculation consists of reading the original target data before the calculation and then comparing the original data with the recalculated data. Data that is identical is not deleted and reinserted.

Ideally (if the calculated data is exactly the same as before), optimization will prevent the deletion of the data interval in the target historical value and its reinsertion. In a less ideal case, at least part of the data will be identical. In this case, data from the first different value to the end of the interval will be deleted and inserted.

If necessary, optimization can be turned off by setting the archive RTM.ARCHIV.OPTIMIZE_RECALC (with the /E-RTM.ARCHIV.OPTIMIZE_RECALC startup parameter or at runtime in the D2000 System Console).

Optimization of multiple recalcs

For the purposes of balancing support services in the MARI and PICASSO systems, another optimization was introduced into the D2000 Archive process in October 2025. If several dependent historical value objects are calculated and the entire recalculation of one of the historical values ended up as identical (i.e., no new values ​​had to be deleted or inserted), then the statistical historical values dependent on it will also not be recalculated. Similarly, if all calculations of source archives (statistical, calculated) that enter the calculated historical value have been optimized, then the calculated historical value in question will also not be recalculated.

This optimization can cause a problem in one case: if some of the calculated/statistical historical values have the Calculation set to Continuous, and those dependent on them are On demand. The former are also calculated continuously, automatically; so when the user-initiated recalculation is performed, they will be optimized out - and subsequent calculations of dependent historical values (calculated on demand) will not be performed. This problem has these possible solutions:

  • The RECALC command has a FORCEONDEMAND option that forces recalculation of dependent archive objects if they have Calculation set to On Demand.
  • Reconfiguring all dependent historical values as continuously calculated (this may, however, have a negative impact on the performance of the D2000 Archiv).
  • Reconfiguring all dependent archives as calculated on demand (this may cause a problem if some of the calculated archives are needed continuously).
  • Adding a trigger (a primary historical value) to the expression of the historical values calculated on demand. Such a trigger will cause them to be calculated, since the primary archive is not calculated, but will always return that it has not been optimized.
  • Disabling optimization by setting the archive RTM.ARCHIV.OPTIMIZE_RECALC (see above).



Napíšte komentár