How to use "Last Snapshot" filter to improve performance on 360Eyes reports
It's always a good practice to use the Snapshot ID filter to prevent combining data from multiple snapshots, which could lead to incorrect results and fail to represent the system's current status. To accurately reflect the current status, you should always use the "Last Snapshot" filter.
Please see the query below as an example:
one simple query which returns the Snapshot Id with the "Last Snapshot" filter, which uses a subquery (see image and subquery highlighted in yellow below)
SELECT
EYE_SNAPSHOT.SNAPSHOT_PERM_ID
FROM
EYE_SNAPSHOT
WHERE
( EYE_SNAPSHOT.SNAPSHOT_NAME='CMS' AND EYE_SNAPSHOT.SNAPSHOT_RESULT = 1 )
AND
( EYE_SNAPSHOT.SNAPSHOT_ID = (SELECT MAX(S.SNAPSHOT_ID) FROM EYE_SNAPSHOT S WHERE S.SNAPSHOT_CMS = 'CMS+NAME:6400' AND SNAPSHOT_NAME='CMS' AND S.SNAPSHOT_RESULT=1 GROUP BY S.SNAPSHOT_CMS) )
Storing the Snapshot ID value in memory allows it to be reused in other queries, which can improve efficiency—especially in reports containing multiple queries. This approach eliminates the need to run the subquery for each query, as would be required if you used the "Last Snapshot" filter individually in every query.