<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Query Store Archives - The SERO Group</title>
	<atom:link href="https://theserogroup.com/tag/query-store/feed/" rel="self" type="application/rss+xml" />
	<link>https://theserogroup.com/tag/query-store/</link>
	<description>SQL Servers Healthy, Secure, And Reliable</description>
	<lastBuildDate>Tue, 20 Jan 2026 19:40:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://theserogroup.com/wp-content/uploads/2024/07/cropped-Canister-only-1-32x32.png</url>
	<title>Query Store Archives - The SERO Group</title>
	<link>https://theserogroup.com/tag/query-store/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">121220030</site>	<item>
		<title>How to Find Queries Causing RESOURCE_SEMAPHORE Waits in SQL Server</title>
		<link>https://theserogroup.com/sql-server/how-to-find-queries-causing-resource_semaphore-waits-in-sql-server/</link>
		
		<dc:creator><![CDATA[Lee Markum]]></dc:creator>
		<pubDate>Wed, 21 Jan 2026 13:00:54 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Development]]></category>
		<category><![CDATA[IT Manager]]></category>
		<category><![CDATA[Query Store]]></category>
		<category><![CDATA[Script Library]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server Management]]></category>
		<guid isPermaLink="false">https://theserogroup.com/?p=7713</guid>

					<description><![CDATA[<p>The resource_semaphore wait can have devastating consequences for SQL Server performance. This wait essentially means that some of the queries in your workload have memory grants that are larger than the memory for the server can support. When that happens, the SQL Server feels like it is frozen and unresponsive. Queries are likely running, but&#8230; <br /> <a class="read-more" href="https://theserogroup.com/sql-server/how-to-find-queries-causing-resource_semaphore-waits-in-sql-server/">Read more</a></p>
<p>The post <a href="https://theserogroup.com/sql-server/how-to-find-queries-causing-resource_semaphore-waits-in-sql-server/">How to Find Queries Causing RESOURCE_SEMAPHORE Waits in SQL Server</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The resource_semaphore wait can have devastating consequences for SQL Server performance. This wait essentially means that some of the queries in your workload have memory grants that are larger than the memory for the server can support. When that happens, the SQL Server feels like it is frozen and unresponsive. Queries are likely running, but this wait causes a queue to build up while submitted queries wait for memory to run.</p>



<h1 class="wp-block-heading" id="h-what-is-the-resource-semaphore-wait">What is the resource_semaphore wait?</h1>



<p>A wait type of resource_semaphore means that there isn&#8217;t enough available memory to grant for queries to run. At a high level, here is what is happening. A query is submitted to the SQL Server engine for execution. As part of the pre-execution phase, SQL Server estimates how much memory it thinks a query will need to run. Several factors influence this memory estimation. Assuming there is free memory to grant to the query, then the query moves along the execution phases and starts running.</p>



<p>But let’s say you have a server with 128 GB of RAM allocated to SQL Server. A series of queries are submitted to the SQL Server database engine that are each granted 15 GB of RAM. At most, SQL Server can handle 8 of those queries before it runs out of memory to allocate. The next query that comes along and needs another 15 GB of RAM is prevented from starting its execution because 8 X 15 = 120 GB of RAM. This 9th query, if granted memory, would cause a total of 135 GB to be allocated. The server doesn’t have that much RAM allocated for queries. So, it has to wait.</p>



<p>As other queries are submitted, they wait behind this 9th query that needs the additional 15 GB of RAM. If the other 8 queries that are already executing are long-running queries, it might be several minutes, or longer, before memory is available. Queries start stacking up behind each other. Users start noticing that the app is slow, pages aren’t refreshing, and reports aren’t completing. Soon, everyone is hitting F5 on the web app to resubmit queries because nothing is happening. Immediately following this, your phone or your Slack messages start blowing up!</p>



<h2 class="wp-block-heading" id="h-how-to-find-queries-with-large-memory-grants">How to find queries with large memory grants</h2>



<p>First, you can use sp_whoisactive to find the queries and the offending wait in real-time. This is very useful for the scenario above, where users feel the pain and start entering tickets and messaging people for help.</p>



<p>However, let’s say, for example, that your server is just teetering on the edge with the memory allocation. Memory grants are occasionally high enough that SQL Server is registering the resource_semaphore wait, but it isn’t happening for long enough, or frequently enough, that users really notice and start complaining. Your SQL Server is experiencing slowness, at times, it’s just not causing excruciating pain. This may show up by this wait appearing low in the result set from Paul Randall’s wait stats query. Maybe it’s only causing a few seconds of wait, on average, when it happens. Users might notice this because their report or application screen completes after a brief wait, so they assume this is “normal.” Consequently, they don’t report it. This doesn’t mean you can or should ignore what the wait stats information is telling you. Act now before this becomes a full-blown emergency.</p>



<p>Second, in the above scenario, you can use Extended Events to find queries with large memory grants. Extended Events are light-weight trace objects that allow for the capture of far more events than Profiler or a server-side trace. They also work differently by only firing and capturing when an event defined in the session happens, versus capturing everything and then filtering like Profiler does.</p>



<h2 class="wp-block-heading" id="h-setting-up-the-extended-events-session">Setting Up The Extended Events Session</h2>



<p>After some poking around and some experimenting, I was able to arrive at the T-SQL below to create the extended event session. This code will capture any query with a memory grant greater than 1 GB. Adjust this higher or lower as makes sense for your environment. The session stores the database ID, plan handle, session ID, and the T-SQL text for the offending query in a file. It will write to as many as 5 files, each 1 GB in size. When the 5th file is full, it will delete the oldest files and start writing a new file.</p>



<p>One thing to be aware of is the path for the file that will hold the data. That path must exist first. I&#8217;m using C:\XE\NameofExtendedEventSession.xel. Be sure to update that path to a location that your SQL Server instance can access. </p>



<pre class="wp-block-code"><code>CREATE EVENT SESSION &#91;TrackHighMemoryGrants] ON SERVER 
ADD EVENT sqlserver.query_memory_grant_usage(
ACTION(sqlserver.database_id,sqlserver.plan_handle,sqlserver.session_id,sqlserver.sql_text)
    WHERE (&#91;granted_memory_kb]&gt;(1024000))),
ADD EVENT sqlserver.query_memory_grant_wait_end(
    ACTION(sqlserver.database_id,sqlserver.session_id,sqlserver.sql_text)
    WHERE (&#91;sqlserver].&#91;database_id]=(8) AND &#91;granted_memory_kb]&gt;(1024000)))
ADD TARGET package0.event_file(SET filename=N'C:\XE\HighMemoryGrants.xel',max_file_size=(1024),max_rollover_files=(5))
WITH (MAX_MEMORY=51200 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)
GO</code></pre>



<p>To start the Extended Events session, run the following T-SQL:</p>



<pre class="wp-block-code"><code>ALTER EVENT SESSION &#91;TrackingHighMemoryGrants]
ON SERVER
STATE = START;</code></pre>



<p>This can also be done from SSMS. Traverse the UI under the SQL instance name to Management &gt; Extended Events &gt; “TrackingHighMemoryGrants”, right click and select the “Start Session” option.</p>



<h2 class="wp-block-heading" id="h-how-to-query-extended-events-files">How to query Extended Events files</h2>



<p>The extended event is gathering data. The query below can parse the collected files to show which queries have the highest memory grants on average.</p>



<pre class="wp-block-code"><code>
WITH ParsedEvents AS (
SELECT 
event_data.value('(event/action&#91;@name="sql_text"]/value)&#91;1]', 'nvarchar(max)') AS sql_text,
event_data.value('(event/data&#91;@name="granted_memory_kb"]/value)&#91;1]', 'bigint') / 1024.0 AS granted_mb
FROM (
    SELECT CAST(event_data AS XML) AS event_data
    FROM sys.fn_xe_file_target_read_file('C:\XE\HighMemoryGrants*.xel', NULL, NULL, NULL)
    ) AS x
)

SELECT 
sql_text,
COUNT(*) AS execution_count,
AVG(granted_mb) AS avg_granted_mb,
MAX(granted_mb) AS max_granted_mb,
MIN(granted_mb) AS min_granted_mb
FROM ParsedEvents
GROUP BY sql_text
ORDER BY avg_granted_mb DESC;
</code></pre>



<p><br>Now you can start dealing with the queries involved in that pesky wait before the problem brings your server to a screeching halt! By the way, the queries may lead you to a design problem in your tables that can cause high memory grants. More about that in a future post!<br></p>



<h2 class="wp-block-heading" id="h-want-to-work-with-the-sero-group">Want to work with The SERO Group?</h2>



<p>Want to learn more about how The SERO Group helps organizations take the guesswork out of managing their SQL Servers? <a href="https://theserogroup.com/contact-us/" target="_blank" rel="noreferrer noopener">Schedule a no-obligation discovery call</a>&nbsp;with us to get started.</p>
<p>The post <a href="https://theserogroup.com/sql-server/how-to-find-queries-causing-resource_semaphore-waits-in-sql-server/">How to Find Queries Causing RESOURCE_SEMAPHORE Waits in SQL Server</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7713</post-id>	</item>
		<item>
		<title>How Query Store Drives Progress Along the SQL Server Maturity Curve</title>
		<link>https://theserogroup.com/sql-server/how-query-store-drives-progress-along-the-sql-server-maturity-curve/</link>
		
		<dc:creator><![CDATA[Lee Markum]]></dc:creator>
		<pubDate>Wed, 10 Dec 2025 13:00:07 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[IT Manager]]></category>
		<category><![CDATA[Query Store]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server Management]]></category>
		<guid isPermaLink="false">https://theserogroup.com/?p=7678</guid>

					<description><![CDATA[<p>We&#8217;ve been learning about SQL Server Query Store lately. We&#8217;ve delved into a few benefits of the feature, as well as how to enable it. In today&#8217;s post, we&#8217;ll discover how this feature can play a role in maturing your SQL Server environment. A Refresher on the SQL Server Maturity Curve First, let’s remind ourselves&#8230; <br /> <a class="read-more" href="https://theserogroup.com/sql-server/how-query-store-drives-progress-along-the-sql-server-maturity-curve/">Read more</a></p>
<p>The post <a href="https://theserogroup.com/sql-server/how-query-store-drives-progress-along-the-sql-server-maturity-curve/">How Query Store Drives Progress Along the SQL Server Maturity Curve</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>We&#8217;ve been learning about SQL Server Query Store lately. We&#8217;ve delved into a few <a href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/" target="_blank" rel="noreferrer noopener">benefits</a> of the feature, as well as how to <a href="https://theserogroup.com/sql-server/how-to-enable-query-store-in-sql-server-a-step-by-step-guide/" target="_blank" rel="noreferrer noopener">enable</a> it. In today&#8217;s post, we&#8217;ll discover how this feature can play a role in maturing your SQL Server environment.</p>



<h3 class="wp-block-heading" id="h-a-refresher-on-the-sql-server-maturity-curve">A Refresher on the SQL Server Maturity Curve</h3>



<p>First, let’s remind ourselves of what the progression of the SQL Server maturity curve looks like, as discussed in <a href="https://theserogroup.com/data-strategy/sql-server-maturity-curve-how-banks-move-from-reactive-risk-to-strategic-advantage/">this</a> blog.</p>



<ol class="wp-block-list">
<li>Reactive—Firefighting</li>



<li>Managed—Gaining control</li>



<li>Optimized—Running proactively</li>



<li>Strategic—Turning data into advantage</li>
</ol>



<h3 class="wp-block-heading" id="h-how-sql-server-query-store-helps-businesses-take-control">How SQL Server Query Store Helps Businesses Take Control</h3>



<p>Query Store’s features can help shift businesses away from break/fix firefighting. Because the Query Store collects runtime metrics for query performance, as well as query plans, businesses aren’t running blind anymore.</p>



<p>You want to know what was going on last Tuesday at 3:15PM when the app was slow? Look at Query Store to see what queries were running and what plans the queries were using. There may have been a change in the query plan, and after that is when people reported that the app was slow. Those query plans may also reveal missing indexes that can help performance.</p>



<p>Additionally, the Query Store report called “Top Resource Consuming Queries” will show how much CPU and RAM were involved in those queries. The Query Wait Statistics report will represent the resources that queries were waiting on as very visible bar graphs. This report enables IT professionals to see that issues like locks or disk IO are affecting their queries.</p>



<p>This type of data gives you the insight needed to start gaining control over your environment.</p>



<h3 class="wp-block-heading" id="h-moving-from-managed-to-strategic-with-query-store">Moving from Managed to Strategic with Query Store</h3>



<p>Now your business can move to the next stage of maturity, which is being proactive. For example, now you can start rewriting queries that were running when the application was slow.  Those missing index recommendations found in various query plans can be evaluated and compared to existing indexes. Perhaps a recommended and existing index can be combined into a single index that can be tested in a lower environment to see if it has a positive impact on the query plan, resulting in lower query durations or lower resource usage.</p>



<p>If the application is from a vendor, then you likely can’t make changes to the queries or indexing, but you now have data to provide the vendor when approaching them with performance problems.</p>



<p>Additionally, you can do things like forcing certain query plans, and in SQL Server 2022, you can apply query hints within Query Store so that even if an application is from a 3<sup>rd</sup> party vendor, you can still make improvements without changing the application code. Query Hints are stored within the Query Store and applied after the code is submitted to SQL Server.</p>



<p>Query Store, then, empowers your business to be strategic. The team can see where the pain points are, test and prioritize issues and solutions, and hand over data to vendors when they can’t make changes themselves. This proactive, strategic work can literally save your business a lot of money by lowering resource usage, allowing for a smaller SQL Server instance. This saves money on licensing and, if you are in the cloud, saves money spent on the size of resources provisioned.</p>



<h3 class="wp-block-heading" id="h-want-to-work-with-the-sero-group">Want to Work with The SERO Group?</h3>



<p>Want to learn more about how The SERO Group helps organizations take the guesswork out of managing their SQL Servers? <a href="https://theserogroup.com/contact-us/" target="_blank" rel="noreferrer noopener">Schedule a no-obligation discovery call</a>&nbsp;with us to get started.</p>
<p>The post <a href="https://theserogroup.com/sql-server/how-query-store-drives-progress-along-the-sql-server-maturity-curve/">How Query Store Drives Progress Along the SQL Server Maturity Curve</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7678</post-id>	</item>
		<item>
		<title>How to Enable Query Store in SQL Server: A Step-by-Step Guide</title>
		<link>https://theserogroup.com/sql-server/how-to-enable-query-store-in-sql-server-a-step-by-step-guide/</link>
		
		<dc:creator><![CDATA[Lee Markum]]></dc:creator>
		<pubDate>Wed, 12 Nov 2025 13:00:05 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Development]]></category>
		<category><![CDATA[IT Manager]]></category>
		<category><![CDATA[Query Store]]></category>
		<category><![CDATA[Script Library]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Script Library]]></category>
		<category><![CDATA[SQL Server Management]]></category>
		<guid isPermaLink="false">https://theserogroup.com/?p=7614</guid>

					<description><![CDATA[<p>In my previous post about Query Store, I wrote about the four key benefits to enabling Query Store. Now that I&#8217;ve convinced you to turn it on, how do you do that? One thing to point out is that in SQL Server 2022 and above, when creating a new database from the SSMS GUI or&#8230; <br /> <a class="read-more" href="https://theserogroup.com/sql-server/how-to-enable-query-store-in-sql-server-a-step-by-step-guide/">Read more</a></p>
<p>The post <a href="https://theserogroup.com/sql-server/how-to-enable-query-store-in-sql-server-a-step-by-step-guide/">How to Enable Query Store in SQL Server: A Step-by-Step Guide</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In <a href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/" target="_blank" rel="noreferrer noopener">my previous post about Quer</a><a href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/">y Store</a>, I wrote about the four key benefits to enabling Query Store. Now that I&#8217;ve convinced you to turn it on, how do you do that?</p>



<p>One thing to point out is that in SQL Server 2022 and above, when creating a new database from the SSMS GUI or by simply using the CREATE DATABASE MyNewDB syntax, the Query Store option will be on by default. For databases restored to SQL Server 2016 or later, the Query Store&#8217;s status from the original system will remain unchanged when the database is restored on the new instance.</p>



<p>Let&#8217;s go through the three ways to enable Query Store.</p>



<ol class="wp-block-list">
<li>Manually in SQL Server Management Studio</li>



<li>Using T-SQL</li>



<li>Using PowerShell</li>
</ol>



<h3 class="wp-block-heading" id="h-1-enabling-query-store-using-sql-server-management-studio">1. Enabling Query Store using SQL Server Management Studio:</h3>



<p>Since you’re likely already comfortable using SQL Server Management Studio for queries and database maintenance, SMSS does offer a convenient, familiar method for getting started with Query Store.</p>



<h4 class="wp-block-heading" id="h-steps-to-enable-query-store-using-ssms">Steps to Enable Query Store using SSMS</h4>



<ol class="wp-block-list">
<li>Connect to a SQL Server instance running SQL Server 2016 or higher.</li>



<li>Click the &#8216;+&#8217; sign next to the Databases folder to expand and see the list of databases.</li>



<li>Right-click on the database name and select &#8220;Properties.&#8221;</li>



<li>Left-click the &#8220;Query Store&#8221; option on the left-hand side of the GUI.</li>



<li>Change the Operation Mode(Requested) option from &#8220;Off&#8221; to &#8220;Read write.&#8221;</li>



<li>Click OK to apply the change and enable Query Store.</li>
</ol>



<h4 class="wp-block-heading" id="h-further-details">Further Details</h4>



<p>Here is what you will see after step 3. The Query Store option mentioned in step 4 is at the bottom of the list of options, like the below.</p>



<figure class="wp-block-image size-full"><a href="https://theserogroup.com/wp-content/uploads/2025/11/SelectingQueryStoreOptionInSelectAPage.png"><img decoding="async" width="172" height="216" src="https://theserogroup.com/wp-content/uploads/2025/11/SelectingQueryStoreOptionInSelectAPage.png" alt="" class="wp-image-7617"/></a></figure>



<p>Left-clicking that Query Store option will cause the below to show up on the right of the SSMS GUI.</p>



<p>What you see when you do that are the existing defaults on 2019 and above. If you are enabling Query Store on versions 2016 or 2017, you will want to adjust additional defaults. Prior to 2019, the default for &#8220;Query Store Capture Mode&#8221; was &#8220;All.&#8221; Change this option to &#8220;Auto&#8221; instead.</p>



<p>Furthermore, the default for Max_Storage_Size_MB was far too low in 2016 and 2017 and could be better in 2019 as well. This value represents the maximum amount of space that Query Store data will occupy in the database in which it was enabled. A good default value to start with is 2048 MB. It may be necessary to adjust that to 4096 MB at the high end in order to capture queries for the entire length of the &#8220;Stale Query Threshold (Days)&#8221; value.</p>



<p>The &#8220;Stale Query Threshold (Days)&#8221; option controls how many days of Query Store data will be kept. If the max storage size is set too low for a retention value of 30 days, then Query Store will start deleting collected data in the system tables to keep Query Store below the max storage size. This could result in having less data available than you intend for troubleshooting.</p>



<p>The rest of the defaults are acceptable and so could be left alone without concern.</p>



<figure class="wp-block-image size-full"><a href="https://theserogroup.com/wp-content/uploads/2025/11/QueryStore2019DefaultsInSSMS-1.png"><img fetchpriority="high" decoding="async" width="699" height="488" src="https://theserogroup.com/wp-content/uploads/2025/11/QueryStore2019DefaultsInSSMS-1.png" alt="" class="wp-image-7621" srcset="https://theserogroup.com/wp-content/uploads/2025/11/QueryStore2019DefaultsInSSMS-1.png 699w, https://theserogroup.com/wp-content/uploads/2025/11/QueryStore2019DefaultsInSSMS-1-300x209.png 300w" sizes="(max-width: 699px) 100vw, 699px" /></a></figure>



<h3 class="wp-block-heading" id="h-2-enabling-query-store-using-t-sql">2. Enabling Query Store using T-SQL</h3>



<p>The T-SQL language is, of course, the language of SQL Server. It is often more flexible than the SSMS GUI. Notice in the screenshot up above that there is a “Script” button. If you click that instead of clicking &#8220;ok&#8221; in the UI, then SQL Server will script out the options in the GUI into a query window. This will allow you to see what the GUI does. Using T-SQL, it is easier to enable Query Store on multiple databases. You can use a construct like sp_msforeachdb to enable Query Store for multiple databases at once.</p>



<pre class="wp-block-code"><code>USE &#91;master]
GO
ALTER DATABASE &#91;MyDB] SET QUERY_STORE = ON
GO
ALTER DATABASE &#91;MyDB] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, MAX_STORAGE_SIZE_MB = 2048)
GO</code></pre>



<h3 class="wp-block-heading" id="h-3-enabling-query-store-using-powershell">3. Enabling Query Store using PowerShell</h3>



<p>Many accidental DBAs, those folks who were “voluntold” to start managing SQL Server, are network engineers, sysadmins, or cloud admins. Automation is often music to their ears, and in the Windows universe, PowerShell is a go-to method for automating tasks. Consequently, using PowerShell to automate the enabling of Query Store may feel natural to accidental DBAs. For the below command, the DBATools module will be needed in your environment.</p>



<p>Below is how Query Store could be enabled on all user databases on an instance of SQL Server. If you only want to enable Query Store on a few select databases on an instance, then add the -Database parameter with a comma-separated list of databases.</p>



<pre class="wp-block-code"><code>Set-DbaDbQueryStoreOption -SqlInstance ServerA -State ReadWrite ​

-FlushInterval 900 -CollectionInterval 60 -MaxSize 4096 ​

-CaptureMode Auto -CleanupMode Auto -StaleQueryThreshold 30, -WaitStatsCaptureMode ON</code></pre>



<p>Also, if your SQL Server environment has the Registered Server feature set up, then PowerShell can be used to read the servers registered there, loop over them, and enable Query Store on all user databases across your environment. This would be done using the Get-DbaRegServer command in the DBATools module.</p>



<h3 class="wp-block-heading" id="h-trace-flags-for-query-store">Trace Flags for Query Store</h3>



<p>If you aren’t familiar with Trace Flags, these are numbers that Microsoft uses to enable certain kinds of behavior in the database engine. They are occasionally meant to be short-term fixes, and later the functionality in a trace flag is built into how the SQL Server database engine works. This is the case for trace flags and Query Store. There are two trace flags to know about and enable. Notice that flag 7752 isn’t needed on SQL Server 2019 and above.</p>



<p>Trace Flag 7745—This prevents Query Store data from writing to disk prior to shutdown or failover process so it doesn’t delay a shutdown or failover.​</p>



<p>Trace Flag 7752 – Loads Query Store data to memory asynchronously from query execution. This default is built into the engine in SQL Server 2019.​</p>



<h3 class="wp-block-heading" id="h-want-to-work-with-the-sero-group">Want to Work With The SERO Group?</h3>



<p>Want to learn more about how The SERO Group helps organizations take the guesswork out of managing their SQL Servers? <a href="https://theserogroup.com/contact-us/" target="_blank" rel="noreferrer noopener">Schedule a no-obligation discovery call</a>&nbsp;with us to get started.</p>
<p>The post <a href="https://theserogroup.com/sql-server/how-to-enable-query-store-in-sql-server-a-step-by-step-guide/">How to Enable Query Store in SQL Server: A Step-by-Step Guide</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7614</post-id>	</item>
		<item>
		<title>4 Key Performance Benefits of Enabling Query Store</title>
		<link>https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/</link>
		
		<dc:creator><![CDATA[Lee Markum]]></dc:creator>
		<pubDate>Wed, 15 Oct 2025 12:00:00 +0000</pubDate>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Development]]></category>
		<category><![CDATA[IT Manager]]></category>
		<category><![CDATA[Query Store]]></category>
		<category><![CDATA[Script Library]]></category>
		<category><![CDATA[Sero]]></category>
		<category><![CDATA[Sero Group]]></category>
		<category><![CDATA[Serogroup]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Consultant]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Consultant]]></category>
		<category><![CDATA[SQL Server Management]]></category>
		<category><![CDATA[The Sero Group]]></category>
		<guid isPermaLink="false">https://theserogroup.com/?p=7565</guid>

					<description><![CDATA[<p>Query Store has been around since SQL Server 2016, but its full potential often goes untapped. Some companies were initially wary of it after some edge case problems arose during its initial rollout. However, since its initial release, Query Store has undergone numerous enhancements and is rapidly establishing itself as one of the most significant&#8230; <br /> <a class="read-more" href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/">Read more</a></p>
<p>The post <a href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/">4 Key Performance Benefits of Enabling Query Store</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Query Store has been around since SQL Server 2016, but its full potential often goes untapped. Some companies were initially wary of it after some edge case problems arose during its initial rollout. However, since its initial release, Query Store has undergone numerous enhancements and is rapidly establishing itself as one of the most significant advancements in SQL Server, comparable to the SQL Server DMVs introduced in SQL Server 2005.</p>



<p>What are the benefits of enabling Query Store? While there are many technical reasons, here are my top four broad advantages to consider.</p>



<h3 class="wp-block-heading" id="h-1-free-sql-server-monitoring">1. Free SQL Server monitoring</h3>



<p>Your business has already paid for Query Store in the SQL Server licensing. With SQL Server 2016 and later, it is accessible at the database level. This means that for smaller shops that may not have a large enterprise environment, you don&#8217;t have to spend large sums of money to get observability from 3rd party software. Query Store&#8217;s native capture mechanisms can provide significant insight into your SQL Server&#8217;s performance, all without costing you any more money!</p>



<h3 class="wp-block-heading" id="h-2-capture-foundational-sql-server-performance-indicators">2. Capture foundational SQL Server performance indicators</h3>



<p>Query Store collects the data already present in your SQL Server, displaying it in easy-to-understand graphs and reports. With Query Store, values for CPU, memory, duration, and more can be viewed based on MAX/AVG/STD Deviation metrics per query. This provides valuable insights into core metrics that shape the performance of your applications. Furthermore, this data allows your company to see not only how specific queries behaved when there was a performance problem but also to trend those queries over time to see shifts in performance.</p>



<p>SQL Server wait statistics are also captured and displayed in Query Store. When a query needs a resource, like CPU, or data read from disk, then a wait type is assigned to the query. These various waits affect query performance in a multitude of ways, and Query Store surfaces those performance-impacting waits for you. For example, the Query Wait Statistics report may show large bar graphs for BUFFER IO and CPU. Queries appearing in both graphs may be suffering from large table scans because of missing indexes.</p>



<p>Additionally, Query Store captures the query plans associated with queries. Think of query plans as the blueprint for how the query will be executed. These plans contain data about the decisions SQL Server is making about your data and how to process it. Some decisions revealed in the query plan can pinpoint performance issues. For example, query plans that regularly contain table scan operators may indicate missing indexes that force SQL Server to scan millions of rows when it only needs to retrieve a few thousand rows.</p>



<h3 class="wp-block-heading" id="h-3-talk-to-your-vendors-with-data-in-hand">3. Talk to your vendors with data in hand</h3>



<p>COTS vendors need to see hard data when approached with a performance problem. Query Store can provide that data. Without it, you can report a problem, but the software vendor is unlikely to consider making changes.</p>



<p>If you engage a DBA as a Service company, having performance data in hand will go a long way toward building a good relationship with that vendor. They will see your preparedness and be drawn to that. Also, it will allow them to solve your problem faster, and isn&#8217;t that what you really want anyway?</p>



<h3 class="wp-block-heading" id="h-4-allow-your-applications-to-take-advantage-of-new-performance-features">4. Allow your applications to take advantage of new performance features</h3>



<p>Newer versions of SQL Server have a collection of features known as Intelligent Query Processing (IQP). Features such as memory grant feedback, degree of parallelism feedback, and more are tied into IQP. These features depend on Query Store. Without Query Store running and without using the appropriate database compatibility level, your applications are missing out on performance-enhancing features that make queries execute faster, use fewer resources, or do both at the same time.</p>



<h3 class="wp-block-heading" id="h-want-to-work-with-the-sero-group">Want to work with The SERO Group?</h3>



<p>Want to learn more about how The SERO Group helps organizations take the guesswork out of managing their SQL Servers? <a href="https://theserogroup.com/contact-us/" target="_blank" rel="noreferrer noopener">Schedule a no-obligation discovery call</a>&nbsp;with us to get started.</p>
<p>The post <a href="https://theserogroup.com/dba/4-key-performance-benefits-of-enabling-query-store/">4 Key Performance Benefits of Enabling Query Store</a> appeared first on <a href="https://theserogroup.com">The SERO Group</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">7565</post-id>	</item>
	</channel>
</rss>
