December 14, 2008 at 1:18 am
Comments posted to this topic are about the item Query Hints
December 15, 2008 at 2:06 am
Personally I would say all four answers are correct because you have the FORCEPLAN option which essentially is a query optimizer hint.
Even BOL talks about a query optimizer hint.
http://msdn.microsoft.com/en-us/library/ms188344.aspx
[font="Verdana"]Markus Bohse[/font]
December 15, 2008 at 7:45 am
Not having that much experience as a developer and even less as a DBA I have followed the recommendation
Because the SQL Server query optimizer typically selects the best execution plan for a query, we recommend that hints be used only as a last resort by experienced developers and database administrators
and leave using hints to those better trained and more knowledgeable
Yet when reading this:
OPTIMIZE FOR ( @variable_name { UNKNOWN | = literal_constant } [ , ...n ] )
Instructs the query optimizer to use a particular value for a local variable when the query is compiled and optimized. The value is used only during query optimization, and not during query execution.
From:
http://msdn.microsoft.com/en-us/library/ms181714.aspx
All of which now leaves me further confused. Can anyone explain when an instruction is not a hint? ? ?
December 15, 2008 at 7:48 am
I was misled by the way BOL is laid out. It would appear from BOL that there are 3 type of Hints, Join Hints, Query Hints and Table Hints. When you select Query Hints it states there are 2, Query Hints and Table Hints, as if a join hint was a hint but not a query hint. I am not sure why it is structured the way it is.
December 15, 2008 at 8:57 am
Arguably not the best question or answer. Hints are an area that I think SQL is a little immature in how to describe/explain them. Please feel free to post suggestions in the BOL area if you think it's confusing and MS will review them. The more people that do that, the more likely they are to change/reword things
December 15, 2008 at 9:15 am
Thanks Steve. Actually I am inclined to agree with Markus and would have selected all four had I not consulted BOL.
December 15, 2008 at 9:58 am
MarkusB (12/15/2008)
Personally I would say all four answers are correct because you have the FORCEPLAN option which essentially is a query optimizer hint.Even BOL talks about a query optimizer hint.
Yup... from there I see the following line.
Query optimizer hints can also be used in queries to affect how SQL Server processes the SELECT statement.
Poor copy editting in books online?
December 15, 2008 at 9:59 am
Cliff Jones (12/15/2008)
Thanks Steve. Actually I am inclined to agree with Markus and would have selected all four had I not consulted BOL.
Depends on what part of it you consult as well... One section doesn't mention them, another does.
December 15, 2008 at 10:02 am
I'd also like to point out that the link to BOL has this... which means there may be more than just the four...
The following hints are described in this section:
That doesn't mean that those are the only hints in existance, just that the following hints are in that section. As provided in the link above... there are optmizer hints as well.
December 15, 2008 at 10:50 am
My guess is that SET FORCEPLAN on is a setting, but likely people writing Books Online are having trouble coordinating things with the product so large.
I'll award points back and edit the 4th answer to be something else.
December 15, 2008 at 11:00 am
Steve Jones - Editor (12/15/2008)
My guess is that SET FORCEPLAN on is a setting, but likely people writing Books Online are having trouble coordinating things with the product so large.I'll award points back and edit the 4th answer to be something else.
I agree that it's better to call SET FORCEPLAN a setting. But the actual plan you force the optimizer to use seems like a hint to me.
Anyway thanks for awarding the point and changing the 4th answer.
Hmmm, messaging hints, what could that be????:hehe::hehe::hehe:
[font="Verdana"]Markus Bohse[/font]
December 16, 2008 at 10:43 am
Steve Jones - Editor (12/15/2008)
My guess is that SET FORCEPLAN on is a setting, but likely people writing Books Online are having trouble coordinating things with the product so large.I'll award points back and edit the 4th answer to be something else.
Great ...
December 16, 2008 at 2:08 pm
Having submitted and had published 7 QODs myself I can only say to those of us (myself included) who rant about how misleading a question can be, l It is NOT easy. Remember Steve does most of the QODs, amongst all his other duties.
So I offer this challenge to you: WRITE AND SUBMIT A QUESTION OF THE DAY Frame it / word it so that there is not a single rant claiming the answer(s) false / misleading or otherwise tainted. Remeber the questions should not be trivial, rather their main purpose is to teach us all about some aspect of SQL Server.
December 16, 2008 at 2:10 pm
Thanks, bitbucket. It is hard, and it's really hard when "making up" answers to not collide with something in BOL. I was sure that calling something an "optimizer hint" was fiction since it wasn't listed.
Oh well,
December 16, 2008 at 2:19 pm
I don't think this one ranked very high on the rant scale. We didn't even fill up 2 complete pages yet.
Viewing 15 posts - 1 through 15 (of 28 total)
You must be logged in to reply to this topic. Login to reply