View Single Post
  #4 (permalink)  
Old 07-22-09, 10:56
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 779
Did you miss a join condition on the userroleassign csuserroleassign table? Your example shows the only limiting criteria on that table is the role id being a 52. Without join criteria to your other tables this would create a cartesian product, which could explain the length of time it takes to sort all rows. Also, when you say data is returned in 18 milliseconds without the distinct, is that all rows or just a first subset of the rows?
Dave
Reply With Quote