SQL Query Optimization
SQL Query Optimization:
1. Use Indexes
2. Avoid SELECT DISTINCT
3. Use WHERE Clause instead of HAVING CLAUSE
SELECT name FROM table_name WHERE age>=18
SELECT age COUNT(A) AS Students FROM table_name GROUP BY age HAVING COUNT(A)>1;
4. Avoid Queries inside a Loop
5. Use Select instead of Select *
6. Add Explain to the Beginning of Queries
7. Keep Wild cards at the End of Phrases
8. Use Exist() instead of Count()
9. Avoid Cartesian Products
10. Consider Denormalization
11. Optimize JOIN Operations
Create queries with INNER JOIN (not WHERE or cross join)
12. Use LIMIT to sample query results
13. Run your query during off-peak hours
SQL Performance Tuning Tools
1. SQL Sentry (SolarWinds)
2. SQL Doctor (IDERA)
3. Profiler (Microsoft)
4. SQL Defrag Manager (IDERA)
5. DB Optimizer (IDERA)
6. SQL Check (IDERA)
7. Foglight for SQL Server (Quest Software)
8. SQL Index Manager (Red Gate Software)
9. Qure Optimizer (DBSophic)
10. DBArtisan® (IDERA)
11. dbWatch Control Center (dbWatch)
12. Plan Explorer (SolarWinds / SentryOne)
13. SQL Diagnostic Manager (IDERA)
14. Database Performance Analyzer (SolarWinds)
15. Applications Manager (ManageEngine)
16. NaviCat for SQL Server (NaviCat)
Comments
Post a Comment