The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
0answers
19 views

Plans created several times under Force Parameterization

People use forced parameterization to save plan compilation cost. However, I found things different here. The query I will run is as following, and under AdventureWorks2012 database: DECLARE @Var ...
8
votes
1answer
231 views

Would it be better for query plans to be split by statement for re-usability?

From my limited knowledge of how query plans are compiled, stored and retrieved by queries I understand that a multi statement query or stored procedure will generate it's query plan which will be ...
2
votes
1answer
98 views

Monitoring the Postgres query parser

As I understand it, when you send a query to Postgres like: SELECT id FROM table1 WHERE name = $1; Postgres will create a query plan. The plan will be cached for the same query in the same ...
1
vote
0answers
93 views

Different Execution Plans Picked for Similar Queries

Thank you in advance for reading it. This question is kind of long and need a little patience to read. I will provide as much details as I can to void interference factors to solve this problem. ...
1
vote
0answers
46 views

Flush procedure cache or drop and create?

Okay I had a very strange issue today on SQL Server 2005. We had a stored procedure update that added new parameters to part of it. One database out of ~150 or more seem to not work properly. Using ...
7
votes
1answer
518 views

Query plan cache bloated by ad-hoc queries, even with “Optimize for Ad-hoc Workloads”

I've been noticing what I thought to be unusual issues with our query plan cache, where the plans in the cache were never more than a day old. Through running the following query (courtesy of ...
2
votes
2answers
516 views

View scripts ran by a specific user?

I read in a stackoverflow post that you can restore scripts from the past 24 hours by using this query: Use <database> SELECT execquery.last_execution_time AS [Date Time], execsql.text AS ...
2
votes
0answers
107 views

plan_generation_num keeps incrementing, why?

I have a query that is executed using sp_executesql code is as follows DECLARE @rsk NVARCHAR(1) = '1', @ppCityID NVARCHAR(3); SET @ppCityID = CAST(@cityID AS NVARCHAR(3)); exec sp_executesql ...
2
votes
1answer
99 views

Will cleaning data cache help to resolve compiler memory pressure?

I currently experience RESOURCE_SEMAPHORE_QUERY_COMPILE waits causing CPU spike 100% that lasts 10-20 mins and disappears only by completely stopping traffic. I figured it could be a memory pressure ...