Tag Info

New answers tagged

1

Without seeing the plan and based on the information you provided, it sounds like you don't have that column, OrganisationID, in one of your existing indexes. Foreign keys aren't automatically indexed, so if it is part of your join or in the where clause then there could possibly be a benefit of adding the index. The missing index feature isn't always ...


2

The difference in logical reads leads me to believe that the two executions are getting different plans. This could be because: there are different set settings between the app that is calling the procedure that profiler is picking up and your instance of SSMS. you have a different default schema (you really should say exec dbo.SM_SP...). You can see if ...


2

I think the best way would be to "prove" that your subqueries - that are compared with a value - do always return one or no value. By making sure they all have either: TOP (1) ... ORDER BY ... (or the equivalent modern ORDER BY ... FETCH NEXT 1 ROWS ONLY) WHERE clause that uses the primary or a unique key, e.g.: WHERE table_id = 496 HAVING clause that ...



Top 50 recent answers are included