- Check that you have primary key in your table.
- Check that you are using in memory table, if so, make sure that the in-memory table also has primary key. If not, you may add temporary primary key as identity column.
- The primary key automatically creates the clustered index and that will improve the performance significantly.
- Avoid using cursors. Use join or recursive query (Common Table Expressions - CTE).
- If you use recursive query make sure that the recursive query doesn't end with infinite loop by using MAXRECURSION property.
- If you use recursive query then make sure that the table uses the statistics.
- If you use temporary table, and that doesn't have primary key, atleast create non clustered index on the temporary table (or in memory table). I strongly suggest to use the in-memory table and use primary key
Some additional performance parameters in your Query to check.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment