Query Store recommended configuration

What are the most important settings, and are default values a good starting point for using Query Store in your database? The most important values are Max Size, Size Based Cleanup Mode, Statistics Collection Interval, and Query Capture Mode, which are explained as follows:

  • Max Size: When the maximum storage size allocated for Query Store is reached, then Query Store switches to Read-Only operation mode and no info is captured anymore: you can only read already captured data. In most of the cases, this is not what you want—you are usually interested in recent data. To leave the most recent data in Query Store the you would need to set Size Based Cleanup Mode to Auto, which instructs a background process to remove the oldest data from the Query Store, when the data size approaches the max size, keeping the most recent data in Query Store, similar to flight recorders in aircraft. However, even for a moderate workload, 100 MB for Query Store storage is not enough. I've seen moderate databases where Query Store contains queries from the last 24 hours only, therefore, I would suggest you increase this value to 1 GB at least and set Size Based Cleanup Mode to Auto to ensure that the most recent data is available and to avoid switching to Read-Only operation mode.
  • Statistics Collection Interval: You can leave this on its default value (1 hour) if you don't need to track queries over time less granular intervals. If your database workload is volatile and depends on time patterns, you can consider using a smaller value. However, bear in mind that this will increase the amount of runtime statistics data.
  • Query Store Capture Mode: Should be set to auto to instruct Query Store to capture info about only relevant queries based on execution count and resource consumption. This will exclude some queries and the captured info will not reflect the whole workload, but the most relevant and important information will be there.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.158.36