August 26, 2014 at 6:06 am
Very good question.
Thanks!
---------------
Mel. 😎
August 26, 2014 at 6:48 am
Nice question.
I like how it underscores the "It depends" with SArg-ability and why in the forums it really is good to have both DDL and execution plans when trying to help performance tune a query.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
August 26, 2014 at 7:14 am
Great question. Thanks!!!
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
August 26, 2014 at 7:22 am
Nice question, I learned something. I assumed the ISNULL function would make it non-Sargable.
Be still, and know that I am God - Psalm 46:10
August 26, 2014 at 8:12 am
Nice question and explanation, Uwe. Thank you.
August 26, 2014 at 9:17 am
Thank you for the post, very very interesting one, never new the word "SARGable" really exists, learnt a good amount of new stuff today. thank you.:-)
ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
August 26, 2014 at 11:11 am
SQLRNNR (8/26/2014)
Nice question.I like how it underscores the "It depends" with SArg-ability and why in the forums it really is good to have both DDL and execution plans when trying to help performance tune a query.
+1
---------------
Mel. 😎
August 26, 2014 at 8:22 pm
I expected the optimiser to use the index on code on the basis that the expression was sargible, however I did not expect a SEEK. I was expecting a SCAN because the expression was WHERE [highlight=#ffff11]!=[/highlight] rather than =. Didn't realise the optimiser would convert != into a SEEK < and SEEK >.
Interesting. Thanks for the question.
August 27, 2014 at 12:09 am
Ok, that was new for me, never encountered a case like this before, so definitly learnt somthing new today, thx.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
August 27, 2014 at 6:26 am
Good Question 🙂
August 27, 2014 at 2:27 pm
I am torn between two opinions on this question.
It is a good question because of the educational value on how the optimizer works and how indexes are (can be) used.
But it is also dangerous - in my experience, the optimizer can be very hard to predict, and things like this can change between versions, or even depending on the weather. This case is pretty obvious and safe, but as a matter of principle I would personally not submit such a question.
August 27, 2014 at 4:09 pm
Hugo Kornelis (8/27/2014)
I am torn between two opinions on this question.It is a good question because of the educational value on how the optimizer works and how indexes are (can be) used.
But it is also dangerous - in my experience, the optimizer can be very hard to predict, and things like this can change between versions, or even depending on the weather. This case is pretty obvious and safe, but as a matter of principle I would personally not submit such a question.
I can see your point, but I think it's reasonable tosubmit the question. People will learn something, and if they don't realise it may change from one release to the next thy should perhaps learn that from other questions. It would of course be nice for some questions if the explanation explained that things might change, but change for this one is so unlikely that I don't think it should in this case.
Tom
January 5, 2017 at 6:06 am
good explaination
- Damian
Viewing 13 posts - 16 through 27 (of 27 total)
You must be logged in to reply to this topic. Login to reply