Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [query-store]

Introduced in SQL Server 2016, the Query Store feature collects execution plans and runtime performance metrics for analysis, troubleshooting, and testing purposes.

3
votes
1answer
107 views

How to find inputs that caused different query plans in Query Store

Query store shows that a completely parameterized query has multiple query plans: How can I find the input that is causing such long response times? Why would the same parameterized query end up ...
5
votes
0answers
51 views

SQL Server 2016 & 2017 Force Plan failing with reason 8695

I'm trying to force a plan using query store but it keeps failing with reason 8695 according to data in SYS.QUERY_STORE_PLAN the last_force_failure_reason_desc is 'General_Failure'. Does anyone know ...
1
vote
1answer
77 views

Don't RESEED tables on Query Store Clean

We are using Query Store. And now we have solved one problem with it by cleaning the Query Store every night. And when you clean the Query Store, the Query Store tables are being RESEEDed :-( Do you ...
1
vote
1answer
165 views

Visual Studio SSDT Ignore Query Store Options in Publish Profile

Is there any way in Visual Studio SSDT Publish Profile, to Totally Ignore Query Store Options Completely? It keeps asking us to Rerun publish code below. I go to Database advanced settings, and turn ...
3
votes
1answer
120 views

How to find when Query Store flushes stale query data? Extended Events not working

I searched online far and wide and didn't see anyone else posting about this so I thought I would. I am trying to audit when the query store does its cleanup and is purged from the query store. There ...
7
votes
0answers
226 views

Blocking caused by Query Store. Unable to clear or disable

I recently updated our 2016 SQL Server to SP2 and the most recent CU (KB4458621) released in August 2018. Just in the last day or so, I noticed that I have some blocking going on. I can't kill the ...
1
vote
1answer
57 views

Monitor SQL Server stored procedure latency

What is the best way to capture SQL Server stored procedure latency in SQL Server 2016? Plan is to create a SSRS report and send it to management. We also enabled query store. Thanks much
9
votes
1answer
196 views

Why doesn't join elimination work with sys.query_store_plan?

The following is a simplification of a performance problem encountered with the Query Store: CREATE TABLE #tears ( plan_id bigint NOT NULL ); INSERT #tears (plan_id) VALUES (1); SELECT T....
2
votes
1answer
86 views

How to search Query Store for a specific word or command in a query?

I have an Enterprise Edition of SQL 2016 SP1, that has a database with Query Store active. I want to search for a specific word or command in the saved queries. I have googled around and not seen ...
2
votes
0answers
43 views

Query store works in dev, but not production in Amazon RDS

I'm having an issue getting query store to collect and record data on our production workload, however, it works as expected on our non-production instances (development and staging). The only ...
4
votes
0answers
473 views

Unbelievably slow and unusable Query Store

I'm begining with Query Store and it's with problems :-( No report of Top Resource Consuming Queries is ever generated. It's just keep saying "Waiting" for hours and hours. Query on the background (...
4
votes
1answer
94 views

Where is this Query Coming From?

I have enabled Query Store on SQL 2017, and I'm seeing at query that's occurring frequently doing a SELECT * on a specific table. I would like to narrow down where this request is coming from and ...
0
votes
1answer
48 views

Auto cleanup querystore not working

We have a SQL Server 2016 SP1 CU7 Enterprise server where we enabled the query store on a database. This is a highly used database.The Max Size has been set to 200MB and Stale Query Threshold is 1 day....
8
votes
1answer
230 views

Never ending Query Store search

I'll say from the beginning that my question/problem looks similar to this previous one, but since I'm not sure if the cause or the starting info is the same, I decided to post my question with some ...
2
votes
1answer
170 views

SQL Server Query Store on isolated volume

Is there a way to isolate Query Store data to a separate volume? I have a thousand or so databases that we’ve gotten pretty good at predicting growth for. I’m unsure of how much storage Query Store ...
1
vote
1answer
64 views

Multiple plans (with/without missing index) in query store for same query

I'm a newbie regarding the query store and have some problems understanding what I'm seeing. We have a third-party application (running on SQL Server 2016 Enterprise SP1 CU7) that uses the query-hints ...
4
votes
1answer
64 views

Query Store Settings

I'm interested in the overall CPU utilization for a database in a time span. I see how to get that, but I'm concerned about the query store retention settings. I don't need detailed info about each ...
2
votes
1answer
137 views

Query Store “Overall Resource Consumption” details

I want to know how much total CPU a database has consumed for a given date span, for all queries. I can see it in SSMS (under Query Store / Overall Resource Consumption), but how can I query for ...
4
votes
1answer
512 views

Database corruption: QueryStore internal table

This morning, the following email alert was received: DATE/TIME: 2/28/2018 9:26:42 AM DESCRIPTION: Attempt to fetch logical page (1:3948712) in database 9 failed. It belongs to ...
5
votes
1answer
147 views

What to consider when setting flush_interval_seconds in SQL Query Store?

Most of the settings for Query Store are fairlying straight forward. But as best as I can tell the one most likely to cause performance issues (waits) and with the least clear documentation is ...
4
votes
1answer
182 views

Can I have 'Query Store' automatically on when I create new databases?

Query Store is available in SQL Server 2016+ and on Azure SQL DB it is on by default. With an on-premises SQL Server, it has to be started on each database individually. Is there a way I can have ...
8
votes
2answers
342 views

What benefit is there from enabling Query Store on msdb?

Of the SQL system database (master, model, msdb, tempdb) query store can only be used on msdb. I looked and don't find any documentation about query store on msdb. While you can't see it in the GUI, ...
3
votes
2answers
2k views

Enable query store for all databases

I want to start using Query Store with suggested setting by Erin Stellato. USE [master] GO ALTER DATABASE DatabaseName SET QUERY_STORE = ON GO ALTER DATABASE DatabaseName SET QUERY_STORE (...
1
vote
1answer
450 views

Query Store - What are the Security permissions needed to view reports?

Query store is enabled on 2 of our production databases but I no longer have access to see the Query Store node under the database since my SA privileges were revoked (I had them temporarily for a new ...
1
vote
0answers
243 views

Query store is slow/unresponsive

When opening the query store for the first time on any give day, it will take a VERY long time to output data. I took a SQL script from this redgate blog article : Top 10 most expensive queries ...
10
votes
4answers
1k views

SQL Server Query Store - What is considered an 'ad-hoc' query?

I've been doing a deep dive into the SQL Server Query Store and I often see references to 'ad-hoc' queries. However, I haven't seen what the Query Store determines an ad-hoc query to be. I've seen ...
0
votes
1answer
155 views

A Query in the Query Store shows high Logical Reads

When I look at the Query Store reports for Top Resource Consuming Queries, there is one query that skews the report so much that I can barely see the next query because this one is so high. Highest ...
9
votes
1answer
634 views

Query Store Force Plan feature doesn't work

Query Store Force plan feature doesn't appear to be enforcing the plan. I'm aware of Query Store - Forced Doesn’t Always Mean Forced; however, my plan may not change insignificantly, but query ...
2
votes
0answers
256 views

Query Store on Amazon RDS

I'm trying to use Query Store on SQL Server on Amazon RDS, and not having any luck. The query store works for a few hours after each failover, but then stops working. For example, our last manual ...
14
votes
1answer
4k views

SQL Server 2016 Bad Query Plan locks up DB once a week

Once a week, for the past 5 weeks, around the same time of day (early morning, may be based on user activity when people are starting to use it), SQL Server 2016 (AWS RDS, mirrored) starts timing out ...
7
votes
1answer
602 views

Does SQL Server Query Store capture parameter values?

The new Query Store introduced in SQL Server 2016 is great. It's a nice replacement for much of what I used to do with the older Profiler tool. However, I haven't found a way to capture parameter ...
2
votes
1answer
425 views

How to interpret Azure SQL QueryStore Query Performance Insight

The Azure SQL QueryStore is supposed to give you insight into what is causing high DTU usage, but I can not figure out what is going on. In some cases, I get good data out of it, and I can pinpoint to ...
1
vote
1answer
411 views

Delete from table with(snapshot)

I was trying to learn querystore. When going through few queries involved in query store one of the query is below DELETE TOP (1000000) FROM [sys].[memory_optimized_history_table_1179151246] WITH (...
0
votes
1answer
100 views

How can you view the Query Store settings for a database?

I see that you can use notion like the following to set the query store configuration: ALTER DATABASE <database name> SET QUERY_STORE (SIZE_BASED_CLEANUP_MODE = AUTO); But how can I ...
3
votes
1answer
712 views

How to list all forced query plans and cancel one

Using SSMS 2016 Query Store I forced a few weeks ago a specific query to use a specific plan. Now every now and then I have the error: Query processor could not produce a query plan because of the ...
6
votes
2answers
2k views

Indexes and Statistics on Temp tables

I've just upgraded our Data warehouse to SQL 2016. I'm seeing some really interesting graphs in the Query Store (I love this feature!). Below is the weirdest example i've seen. 22 plans for the same ...
3
votes
1answer
3k views

Problems caused by SQL Server 2016 Query Store

I have been testing SQL Server 2016 (Standard) on an Azure VM and have encountered a problem. In my SQL logs I am seeing SQLExceptions and eventid 1001 and this is happening every 15 minutes. 2016-...
3
votes
1answer
1k views

How to enable query store on the SSMS object browser with Sql Azure?

I am following this guide: Monitoring Performance By Using the Query Store I am using SSMS 2016 CTP3.2 and Sql Azure V12 I have enabled the query store on the database properties. I can use the ...