8 January 2014

Sql Query Optimization Tips and Tricks



1.       Try to use columns name inplace of * in the select statements.
2.       Try to create non-clustered indexes on table columns.
3.       Try to avoid function calls in the query.
4.       Try to create primary key on each table.
5.       Try to avoid COUNT() method in the query for checking esistance of record.
6.       Try to avoid as much as triggers count on the table.
7.       While doing sql join operations use only index columns.
8.      Try to avoid UNION, instead of that use UNION ALL
9.       Try to use Table Variables instead of tamporary tables in the procedrues, functions or triggers.
10.   Try to use Stored procedures instead of normal text queries.
11.    Try to avoid using cursors.
12.    Try to avoid having clause.
13.    Try to use where condition for narrowing the query search.

No comments:

Post a Comment