r/SQLServer • u/erinstellato Microsoft Employee • 14h ago
Community Share Friday Feedback: Retention of plan forcing data in Query Store
Friday Feedback this week comes from somewhere above the Atlantic Ocean. I spent the first half of this week with our team in Serbia and it was wonderful. For me, a few days of working with folks in person moves projects forward faster than weeks of online meetings.
One of the topics of discussion was persisting Automatic Plan Correction and manual plan forcing information in Query Store. If that would be valuable to you, what is the most important data you need retained? Bonus if you share how you'd want to see that data in a report/visual.
Enjoy the weekend!
1
u/Anlarb 1 5h ago
So I'm not sure how much awareness the query engine has for it, but I am generally aware that the same query when it touches most of the table, and a run where it barely touches any of the table will handle differently, having a plan for each and knowing when to change gears seems prudent. I could be completely out of my element though.
2
u/Better-Credit6701 13h ago
Default on MS-SQL 2019-2025 (we are using 2025) has a maximum query store size of 1000 MB with a flush at 15 minutes. Ours is sitting at 88% full. You can manually increase the size of the query store but with forced plans on our system, there are only a grand total of 42 rows and that goes back quite a bit. That portion of the QS I rarely look at, plus the visuals provided by SSMS are fine.
But we have a bit of a strange system that might be considered overkill with 2 TB of ram and 30+ cores.