0

how can i optimize a sql query to get the best performance and monitoring it, i want to compare two or more querys performance

César Villaseñor
  • 822
  • 1
  • 7
  • 15

1 Answers1

1

There are so many things you can do to optimize your sql query.

Following are the few tips:-

  1. Look at the execution plan of your query.
  2. Turn on IO statistics on and see the reads, writes
  3. Make sure you are not casting a column on the table instead you should cast the variable being passed in.(Only valid if you are passing in parameters)
  4. Make sure you are joining on clustered indexes or Indexes are properly set on columns in table.
  5. Avoid wildcard characters in the start of the expression. For example:- like "%abc%"
Nirjhar Vermani
  • 1,215
  • 8
  • 17