Linked Questions

2 votes
3 answers
555 views

Critical query plans removed from sys.dm_exec_query_stats while trivial items are kept [duplicate]

Running SQL Server Express 2019. Have a complicated stored procedure containing 11 sql statements (when selected from sys.dm_exec_query_stats by plan_handle). 9 of those statements are simple variable ...
roman m's user avatar
  • 125
0 votes
1 answer
2k views

Good practices for proactively preventing queries from randomly becoming slow [duplicate]

We support several deployments of an in-house application based on SQL Server. We've had a problem several times now where some query that used to be quick and small suddenly becomes very slow or ...
liori's user avatar
  • 289
5 votes
1 answer
2k views

Understand why the query plan was changed [duplicate]

We had some performance issues with our ERP system. Somewhere around 06:00 the problem started. Long story short; one of my colleagues executed a DBCC FREEPROCCACHE (I know that this is not a ...
Niels Broertjes's user avatar
0 votes
1 answer
595 views

Slow stored procedure performance [duplicate]

I have a stored procedure that used to run fine without any issues before we made this change last evening and now the performance is unacceptable. The stored proc pulls data based on information in ...
Feivel's user avatar
  • 507
1 vote
0 answers
350 views

Poor Query performance when scalar variables used in Query [duplicate]

Facing a strange issue that a query runs incredibly slow (worse) when scalar variables are used as parameter. Actual Query (Faster) - 9 secs select sum(v.sale_value) as col_0_0_, sum(v.vat_value)...
The Coder's user avatar
  • 299
-1 votes
1 answer
75 views

MS SQL Server unexplained differences in query speed [duplicate]

I have a production database and staging database, they contain the exact same data, the production database was backed up and restored as the staging database. A particular operation (API call) ...
Paul's user avatar
  • 101
0 votes
0 answers
29 views

Multiple Ad-Hoc Statements taking longer than previous days [duplicate]

We have a Data Warehouse product which runs a number of ad-hoc (IE SQL Text, not stored procs or dynamic SQL) every night. The build took significantly longer last night than previous nights and ...
SE1986's user avatar
  • 2,000
0 votes
1 answer
34 views

Proc runinng slow once in a while [duplicate]

I am trying to troubleshoot the performance issue on one of the SP which executes throughout the day daily every 20 mins and on avg completes under a min. For past couple of weeks it happens once in ...
BeginnerDBA's user avatar
  • 2,180
7 votes
2 answers
549 views

Force SQL Server to use fragmented indexes?

I have a quite large table (>10M rows) with frequent crud operations. It has proper indexes, but they get fragmented quickly. Without a periodic index reorganize/rebuild maintenance plan, the index ...
mikaelnet's user avatar
  • 173
1 vote
3 answers
2k views

Slow query in production, bad execution plan or bad index?

I've just fixed a production performance issue by dropping an index and recreate it. I suspect dropping the index also dropped executions plans that used it and one of them happen to be bad. Arguments ...
AXMIM's user avatar
  • 111
2 votes
2 answers
729 views

Example of query execution plan where the cardinality estimation makes a difference

I am trying to create an example of a query execution plan which shows that if I have the cardinality estimation for some column of a table I can decide which query execution plan has the least cost. ...
Felipe's user avatar
  • 161
-3 votes
3 answers
870 views

Slowly running a query that always runs fast

I have two tables that 99% of operation on it is simple select. Rarely we have insert/delete and updates. There is a inner join on these tables and execution plan of the query is index seek. 99% of ...
DooDoo's user avatar
  • 203
12 votes
1 answer
1k views

Is this a symptom of an overloaded server?

I've been trying to diagnose slow-downs in an application. For this I've logged the SQL Server extended events. For this question i'm looking at one particular stored procedure. But there are a ...
Ian Boyd's user avatar
  • 976
4 votes
1 answer
737 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 ...
Vlad's user avatar
  • 143
5 votes
1 answer
2k views

SQL Server - Very high disk activity after running query?

I'm running SQL Server Express 12.0.4100 on an AWS instance with 16 cores and 64 GB of RAM with a 3TB and 9000 IOPS EBS attached. This has been running for 2 years perfectly with no issues until this ...
Andres's user avatar
  • 183

15 30 50 per page