Hi,
Query optimization is the required thing in SQL-Server. If we use the following steps in our query then we can get the better performance in SQL-Server.
Query optimization is the required thing in SQL-Server. If we use the following steps in our query then we can get the better performance in SQL-Server.
- Provide the primary key in all the tables
- Avoid using the Boolean operators >, <, >=, <=, is null, is not null
- Avoid using the Not in, !=, Like '%pattern', not exists
- Avoid using the Calculations on unindexed columns or (use union instead), Having (use a WHERE clause instead)
- Don't use function in where clause, instead of use that funtion in where clause.
- Enable aliases to prefix all columns
- use with no lock after the table name
- Return only that column which are required
- Those table which have less number of record use that table first in inner join
- Try to avoid sorting in the select Statement. If possible then do the sorting at the client level.
No comments:
Post a Comment