Query optimization tips

Query optimization tips.

Query optimizations tips:
- Always use a WHERE clause to restrict the number of returned queries.
- Only return the needed columns and rows that are needed by a query. Be wise of these while writing any query.
- Use views and stored procedures efficiently instead of complex queries.
- Avoid use of cursors wherever possible.
- Use SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') instead of SELECT COUNT(*) to know the number of rows returned.
- Use constraints instead of triggers when applicable.
- Use table variables efficiently.
- Avoid use of HAVING and DISTINCT clause.
- Use UINION ALL instead of UNION wherever possible.
- Do not use optimizer hints in queries.

Query optimization tips.

- Use indexes.
- Specify only the columns necessary while using select query.
- If join queries are used, indexes that match the join column must be used.
Backup devices offered by SQL Server 2000
Disk devices: These are files that are stored on the hard disk or some other storage media. They can be of a variable size........
Database backup methods
Full Backups Differential Backups Transaction Log Architecture Backups.......
Full Backups - Sql server
Full backups, as the name suggests is a back up of the files and folders. Frequent full backups results in a faster restore........
Post your comment