19. Keyboard Shortcuts
Assign shortcuts
you frequently use
Remove shortcuts you
accidentally click
(no more "ooops")
msdn.microsoft.com/en-us/library/ms174205.aspx
44. SARGable Queries
"The query can efficiently seek using an index to find
the rows searched for in WHERE or JOIN clauses"
Compare it to finding a person in a phone book
(…let's just pretend we still use phone books…)
45. SARGable Queries
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Find all rows where Name starts with 'T'
46. SARGable Queries
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Find all rows where Name starts with 'T'
47. Non-SARGable Queries
"The query has to scan each row in the table to find
the rows searched for in WHERE or JOIN clauses"
Compare it to finding a person in a phone book
(…let's just keep pretending we still use phone books…)
48. Non-SARGable Queries
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Find all rows where Name contains 'al'
49. Non-SARGable Queries
Adama, Lee
Adama, William
Agathon, Karl
Baltar, Gaius
Dualla, Anastasia
Gaeta, Felix
Henderson, Cally
Roslin, Laura
Thrace, Kara
Tigh, Saul
Tyrol, Galen
Valerii, Sharon
Find all rows where Name contains 'al'
50. WHERE LEFT(Name,1,1) = 'T'
WHERE YEAR(EpisodeDate) = 2005
WHERE EpisodeDate >= '20050101'
AND EpisodeDate < '20060101'
SARGable or Non-SARGable?
51. WHERE LEFT(Name,1,1) = 'T'
WHERE YEAR(EpisodeDate) = 2005
WHERE EpisodeDate >= '20050101'
AND EpisodeDate < '20060101'
SARGable or Non-SARGable?