Viewing 12 posts - 1 through 12 (of 12 total)
peter (1/10/2009)
January 12, 2009 at 4:59 am
peter (1/10/2009)
January 10, 2009 at 6:41 am
Adam Haines (1/8/2009)
...First there should be some sort of filter in the first CTE. This way you can reduce the amount of data searched through...
You are using CTE...
January 10, 2009 at 3:16 am
Adam Haines (1/7/2009) ...Unfortunately, this still should yield a index scan. The case expression is still evaluated for every row, as the optimizer doesnt know if the variable matches...
January 8, 2009 at 5:28 am
TheSQLGuru (1/7/2009)
phystech (1/7/2009)
TheSQLGuru (1/7/2009)
...If you never passed in a NULL value then the CASE is surperfluous, right?..
No, zero length string plays the role of NULL. That is if...
January 7, 2009 at 1:07 pm
Adam Haines (1/7/2009)
...Can you confirm that the code you are posting actually generates index seeks?...
I need a couple of days to prove/disprove it, right now I'm working on my...
January 7, 2009 at 12:40 pm
TheSQLGuru (1/7/2009)
...If you never passed in a NULL value then the CASE is surperfluous, right?..
No, zero length string plays the role of NULL. That is if the parameter...
January 7, 2009 at 11:28 am
TheSQLGuru (1/7/2009)
phystech (1/6/2009)
Adam Haines (1/6/2009)
The optimizer knows that
"CASE WHEN @FirstName IS NOT NULL THEN"
can be evaluated before the query is launched, since no column name is involved here...
January 7, 2009 at 10:16 am
Adam Haines (1/6/2009)
WHERE CASE
WHEN @FirstName IS NOT NULL THEN
CASE WHEN FirstName = @FirstName THEN 1
...
January 6, 2009 at 4:30 pm
Adam Haines (1/6/2009)
phystech (1/6/2009)
What can we do to make this query index seek? Well, we really only have two options. One is to use dynamic sql to build...
January 6, 2009 at 3:31 pm
What can we do to make this query index seek? Well, we really only have two options. One is to use dynamic sql to build the predicate dynamically....
January 6, 2009 at 2:40 pm
John Magnabosco (8/25/2008)
August 25, 2008 at 5:16 am
Viewing 12 posts - 1 through 12 (of 12 total)