Skip to main content

Documentation Portal

Historical Indexing FAQs

What is historical indexing?

Historical indexing is also referred to as 'backward indexing'. It's the process of building up index data between now and the index horizon.

Historical indexing is triggered the first time a tag is used, typically when it is added to the chart by a user, or when it's triggered by a script like the batch indexing script.

While historical indexing is in progress the index status of a tag is 'in progress'.

How does historical indexing work?

Backward indexing adds index data per month, building up from the most recent month (this month) all the way back to the index horizon.

The 3 most recent months are built up with high priority, meaning they get priority over other indexing requests in the queue (for example forward index requests which keep tag indexes up to date). Index requests for older months get a normal priority, which typically means it takes a bit longer to process them. As a result you might notice that backward indexing goes fast at first but then seems to slow down.

Per tag only 1 index request is processed at a time. So only when month X is indexed, the request for month X-1 is added to the queue for processing.

How long does it take to complete the historical indexing for 1 tag?

The time needed to finish historical indexing for 1 tag depends on:

  • The response time of the data source: if it takes 5 seconds to get 1 month of data from a data source and you need to build up 5 years of data it will take at least 5 minutes to complete the full 5 years of historical indexing.

  • The total number of indexed tags for that data source: the more tags are indexed for a data source, the more continuous indexing (forward indexing) will occur. Since the backward index tasks are added in the queue, all index tasks already in the queue need to be processed before the backward index task gets processed.

    Important to note here is that each backward index task (1 month of data) has a max queue time of 1 hour before it is assigned high priority. When a task gets a high priority it jumps to the front of the queue for immediate processing. As a result, on a system which is under heavy load it can be expected that it takes up to 1 hour for 1 month of data to be added to the historical index (and therefore the indexing progress of that tag updates only once per hour)!

  • Simultaneous index operations: besides the number of indexed tags on 1 data source there is also a global setting which manages the number of indexing threads which are shared across all data sources. More detailed information can be found here: How to determine the best "simultaneous index operations" configuration?

A simple rule of thumb is that on highly congested systems backward indexing should progress at a rate of at least 1 month per hour per tag. If progress is slower further investigation could be useful.