SQL Optimization techniques


  • Limit the number of column returned in query
  • Create a primary key on the table
  • Create a Index on the column in the where clause
  • Limit the numer of rows by TOP
  • When working with the Join have an Index on the column used in join
  • If you are using multiple column in where or order by create compound index and pay attention to the order of the index
  • When you are trying to get Unique values use ORDER BY instead of DISTINCT
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s