I've got a query that is taking a very long time to run due to a select similar to:
SELECT
Count( Distinct t1.v1),
Count (Distinct
Case t2.v1 When 'blah' then t1.v1
Else null
End ),
....
FROM t1
LEFT JOIN t2 ON t1.v3 = t2.v3
WHERE t1.myDate BETWEEN @start and @end
AND t2.v5 = @id
Can anyone suggest any good methods for improving this performance?