Reputation
10,436
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 17 32
Newest
 Guru
Impact
~319k people reached

1d
awarded  Guru
2d
revised Execution Plan is NOT using INDEX and uses Table Scan
added 69 characters in body
Apr
25
revised Execution Plan is NOT using INDEX and uses Table Scan
added 6 characters in body
Apr
24
comment Finding hash match aggregate
I don't know that it's worthwhile to do this . Blocking operators will stop the first row appearing quickly, but are not necessarily bad.
Apr
23
revised Execution Plan is NOT using INDEX and uses Table Scan
added 120 characters in body
Apr
23
answered Execution Plan is NOT using INDEX and uses Table Scan
Apr
15
comment How to order the where clause and join columns in a covering index?
Yes, but the Optimizer doesn't do that. If you had WHERE CustomerID IS NOT NULL it will simplify it out, even though that predicate looks like it's redundant.
Apr
14
comment OrderBy int slow for large table join
The reason for this is that I want it to search through the sizes in order, using the only sargable predicate on the widgets table, and then look to see if each one is Red and Available, until it finds one. Theoretically, it should only need to check about six rows until it gets one.
Apr
14
comment OrderBy int slow for large table join
I'd expect it to take the same amount of time, because it still needs to sort that data to find the smallest one. An odd suggestion, but what if you break the Sargability on the joins. Like this: ON '' + Widgets.ColorCode = Colors.ColorCode and ON 0 + Widgets.StatusId = Statuses.Id ?
Apr
14
comment OrderBy int slow for large table join
So the selectivity of Red and Available must make it think it'll be quicker to do the TopN Sort. Without the TOP 1 how many rows are returned?
Apr
13
answered OrderBy int slow for large table join
Apr
13
comment Shrinking database which is not having any insert/update
When you change the database to the simple recovery model you don't need to back it up to complete the process. That's only when you change it to full.
Apr
13
comment Shrinking database which is not having any insert/update
@azim - So do your restore first as a different (maybe the original) name,and then copy the data into a new database. This method of getting a "shrunk" database without fragmentation is quite common and the best approach. And do try compressing it, as the CPU load of decompressing it is typically less than the load of getting it off the disk. And you've already hinted that disk space is a premium. But you can test it if you're worried.
Apr
13
answered Shrinking database which is not having any insert/update
Apr
6
answered Searching from Database having billion records, which database should i use
Mar
27
revised Find a longest sequence that doesn't have duplicates inside
added 498 characters in body
Mar
27
answered IN Clause - listing values VS query
Mar
27
answered Optimising file shrink and index reorganization operations
Mar
26
answered Find a longest sequence that doesn't have duplicates inside
Mar
26
reviewed Reviewed Find a longest sequence that doesn't have duplicates inside