'How to deal with high frequency queries

I have a query that should run every 30 seconds. I am doing so because I want to track if the Cycle Time which is displayed in seconds, decreases or increases for a given timerange. If it execedes the accepted limit, I will get a notification.

Here a more specific display : The aim is to have a cycle time < 60s, because we are working in seconds a one time increase or decrease of the cyle time would not be very meaningful, so what I would do is take the last ten cyle times and calculate the average of it. If this > 60 seconds I will get notified.

BUT To make the tracking as accurate as possible I need the query to run evey 30 seconds. QUERY :

    SELECT 

      CAST([Cycletime (s)] as Float) as [Cycletime  (s)]
      ,Machine
      ,Date
      FROM v_Analysis
      WHERE Date >= CAST( GETDATE() AS Date )
       

My question now is how much is the 30 seconds intervall of the query is affecting the performace of the database and if so how do we improve the performance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source