Efficient query writing it’s not a tough job. We are
easily achieving it to following some point when writing a query. Here present
some of them. I hope it's help you to writing efficient query.
write an efficient query |
- Ensure proper joins for whatever tables in from clause.
- Avoid multiple table views.
- Instead of using the whole query in a single cursor or group, split into multiple Groups and link them.
- Use 'union all' instead of Union
- Use Union instead of OR Clause.
- Use Exists in place of in
- Always avoid usage of Negation operators like NOT, !=.
- Avoid Usage of outer joins , use Equi joins where ever possible 9. Use Where Clause instead of Having Clause.
Comments
Post a Comment