Manage the Size of the Primary Index

When a ClearSCADA server is started it creates and maintains a Primary index of the historic data granules in that server (a granule is a file that holds the historic data for one item for a period of one week, see Historic Types and Streams). The Primary index allows your system to retrieve historic data quickly. The Primary index is created and kept in memory and is rebuilt each time that the server is restarted.

ClearSCADA does not create an index for Alarm Summary, Event Journal or Configuration Changes data that is kept online.

Understanding the Primary index

The size of the Primary index, and the amount of memory it requires, is dependent on:

You can use the following calculation to determine the maximum amount of memory required for the Primary index:

Total Historic Items × Primary Weeks × Primary Granule Size

  64-bit Server 32-bit Server
Primary Index 96 bytes per granule 68 bytes per granule

Understanding the Secondary index

ClearSCADA provides a feature that allows you to limit the size of the Primary index. The feature works by defining the amount of online historic data that remains in the Primary index, and ClearSCADA creates a second more compact Secondary index for the remaining online historic data. The Secondary index takes up much less memory per granule than the Primary index, and so the index is smaller as indicated in the table below.

  64-bit Server 32-bit Server
Primary Index 96 bytes per granule 68 bytes per granule
Secondary Index 8 bytes per granule 8 bytes per granule

How to manage the Primary index

The Primary index is by default applied to all historic data. When deciding how many weeks’ worth of historic data to store in the primary index, you should consider the following factors:

To manage the size of the Primary index and create a Secondary index:

  1. Access the ClearSCADA Server Configuration Tool.
  2. Expand the Historic Configuration branch.
  3. Select the Historic Data entry.
  4. Use the Index After check box to manage the size of the Primary index. (Select to enable the feature; clear to disable the feature).

  5. If you select the Index after check box and use the field to define how long the historic data granules will be in the Primary index, granules that are older than the number of weeks you specify will be in the Secondary index. The period is measured from the start of the week in which the server was last started.

    The higher the number / duration, the more memory will be required for the index.

     

    In this example the Keep Online for is set to 25yrs (1300 weeks) and the Index after is set to 1yr (52 weeks).

  6. Right-click on the server icon and select the Apply Changes option to update the server’s configuration. The changes will come into effect the next time the server is restarted.

Calculate the Amount of Memory Required by the Primary and Secondary Index

The amount of memory required by the Primary and Secondary index is determined by four factors:

Effects of Queries and Archive Volumes

When granules in the secondary index are queried, they are promoted into the primary index. Additional memory is required while the granules remain in the loaded granule cache. The size of the cache and the queries being performed will determine how much additional memory is required.

All granules in a mounted archive volume are added to the primary index. Additional memory is required until the archive volume is dismounted.

Using this information you can determine the best compromise between the memory required by the primary index and the restrictions imposed by using this feature.

Secondary Index Restrictions

When the Secondary index is enabled in a Hot Standby / Main server, granules that fall within the Secondary index have certain restrictions:

When a granule in the secondary index is queried, it is promoted into the primary index (and therefore will require more memory). It is demoted back into the secondary index when it is purged from the loaded granule cache. (For more information on the loaded granule cache, (see Define the Historic Data Cache Size).

Only granules in the Raw and Suppression historic data types support the long term storage index. Granules in the Modified and Annotation historic data types only have a writable / syncable period, (see Historic Types and Streams).

If you are using both archiving together with the Primary and Secondary index, the granules in the secondary index can be archived. When an archive volume is mounted, all of the granules contained on the archive volume are stored in the primary index, regardless of their age.


Disclaimer

ClearSCADA 2017 R3