Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server Newbies
»
Forced Parameterization
Forced Parameterization
Rate Topic
Display Mode
Topic Options
Author
Message
SQLSACT
SQLSACT
Posted Tuesday, January 22, 2013 4:15 AM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 7:48 AM
Points: 1,201,
Visits: 2,126
Hi All
Having checked the web and done some testing, I just want to confirm my understanding of SQL's plan cache
Am I right in that when your Database is under Forced Parameterization, it acts the same as Simple Parameterization but for all Ad-Hoc queries.
I've tested the setting on my system and it seems that Forced Parameterization creates nonparameratized plan shells, the same way Simple Parameterization would, if the query qualified for it.
Am I on track here
Thanks
Post #1409916
Grant Fritchey
Grant Fritchey
Posted Wednesday, January 23, 2013 4:37 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:09 PM
Points: 13,383,
Visits: 25,187
There's a pretty focused set of requirements for forced parameterization to work. It's a lot more expanded than simple parameterization, but it does not include ALL ad hoc queries. Microsoft has the requirements
documented in the Books Online.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1410473
SQLSACT
SQLSACT
Posted Wednesday, January 23, 2013 11:20 AM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 7:48 AM
Points: 1,201,
Visits: 2,126
Grant Fritchey (1/23/2013)
There's a pretty focused set of requirements for forced parameterization to work. It's a lot more expanded than simple parameterization, but it does not include ALL ad hoc queries. Microsoft has the requirements
documented in the Books Online.
Thanks
I just wanted to confirm that with Forced Parameterization - We will deal with plan "shells" ?
Thanks
Post #1410723
Grant Fritchey
Grant Fritchey
Posted Wednesday, January 23, 2013 11:52 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:09 PM
Points: 13,383,
Visits: 25,187
SQLSACT (1/23/2013)
Grant Fritchey (1/23/2013)
There's a pretty focused set of requirements for forced parameterization to work. It's a lot more expanded than simple parameterization, but it does not include ALL ad hoc queries. Microsoft has the requirements
documented in the Books Online.
Thanks
I just wanted to confirm that with Forced Parameterization - We will deal with plan "shells" ?
Thanks
Plan shells? Not sure what you mean. If you mean plan stubs, then no, that's not from Forced Parameterization. It's from
Optimize for Ad Hoc
. It's a different setting entirely.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1410738
SQLSACT
SQLSACT
Posted Wednesday, January 23, 2013 11:04 PM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 7:48 AM
Points: 1,201,
Visits: 2,126
Grant Fritchey (1/23/2013)
SQLSACT (1/23/2013)
Grant Fritchey (1/23/2013)
There's a pretty focused set of requirements for forced parameterization to work. It's a lot more expanded than simple parameterization, but it does not include ALL ad hoc queries. Microsoft has the requirements
documented in the Books Online.
Thanks
I just wanted to confirm that with Forced Parameterization - We will deal with plan "shells" ?
Thanks
Plan shells? Not sure what you mean. If you mean plan stubs, then no, that's not from Forced Parameterization. It's from
Optimize for Ad Hoc
. It's a different setting entirely.
Thanks
No, not stubs
By Shells, I mean this:
These ad-hoc entries are shell queries, cached just to make the parameterised form of the query easier to find. All the execution plan contains for these shell queries is a pointer to the plan for the parameterised version of the query.
- Taken from
http://sqlinthewild.co.za/index.php/2010/08/31/come-and-gone/
Under Simple Parameterization, if a Query qualifies for it, SQL caches a Parameterized plan with an objtype of "Prepared", any subsequent queries that make use of that plan is also cached, as "Non Parameterized Shell Queries" with an objtype of "AdHoc"
I was noticing the same thing happening with Forced Parameterization.
Post #1410906
Grant Fritchey
Grant Fritchey
Posted Thursday, January 24, 2013 4:49 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 1:09 PM
Points: 13,383,
Visits: 25,187
Not a detail I had noticed before. But yes, the shells are there. I recreated Gail's tests.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1411060
SQLSACT
SQLSACT
Posted Thursday, January 24, 2013 6:37 AM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 7:48 AM
Points: 1,201,
Visits: 2,126
Grant Fritchey (1/24/2013)
Not a detail I had noticed before. But yes, the shells are there. I recreated Gail's tests.
Great Stuff, Thanks
It would be great if SQL could single out the Plan Shells, so that when we query against the cached_plans DMV, it shows that this is a Shell Query
Thanks
Post #1411108
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.