none
Why Query Store Not Returning any data? RRS feed

  • Question

  • I'm investigating the CPU Spike incident from last week and checking on Query Store for the Queries that were consuming the highest Memory on that particular day and time. It was returning data in the beginning but now all of a sudden it doesn't return anything except a grey screen as in the screenshot:

    Getting info from the plan cache is not an option as the plan cache was flushed due to memory pressure I believe. 

    Any help would be appreciated. 

     
    • Edited by Shaddy_1 Wednesday, September 18, 2019 9:14 PM
    Wednesday, September 18, 2019 8:58 PM

Answers

  • Data is not stored forever in Query Store, but there are several limits to keep it check. Depending on how busy your system is, the information you are looking for may be gone.

    You can look in sys.query_store_runtime_stats_interval to see which intervals you currently have data for in the database.

    The good news is that if you restore a backup from a few days back on some other server, the Query Store data is there.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by Shaddy_1 Wednesday, September 18, 2019 9:32 PM
    Wednesday, September 18, 2019 9:20 PM

All replies

  • Data is not stored forever in Query Store, but there are several limits to keep it check. Depending on how busy your system is, the information you are looking for may be gone.

    You can look in sys.query_store_runtime_stats_interval to see which intervals you currently have data for in the database.

    The good news is that if you restore a backup from a few days back on some other server, the Query Store data is there.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Marked as answer by Shaddy_1 Wednesday, September 18, 2019 9:32 PM
    Wednesday, September 18, 2019 9:20 PM
  • Thank you for a very clear answer. Did not thought about the old backup restore would have the data. 
    Wednesday, September 18, 2019 9:33 PM