Sql Query : Performance

Improving Sql Query performance,
Here is tips to boost your sql queries when you feel tables are very heavy.
1. Avoid using temporary table.
2. Avoid using unions. joins.
3. Try to query one table only once . Take help of case statement in select clause and where clause.
4. Use Index. put table field in same order in where clause and group by clause , as they are in
Index.
5. Always check for execution plan. Check execution plan for different order of select queries.
6. In execution plan look for index being used or not.
7. In execution plan check which part is taking maximum time and try to reduce that.
8. Avoid group by and grouping clauase.
9. If index is take more time then Rebuild your indexes.
10. Dont totally depend on database utilities to prepare report format. Divide your work so that
some filtering, ordering, grouping, aggregating be done from dot net code behind side.

Comments