Deepak Nayak
what is query optimization
Posted by Deepak Nayak in Database | SQL Server on Aug 28, 2011
0
Do you know the answer for this question? Post it below.
Guest

Optimization Tips:


  •  Use views and stored procedures instead of heavy-duty queries.
  • Try to use constraints instead of triggers, whenever possible.
  • Use table variables instead of temporary tables.
  • Try to use UNION ALL statement instead of UNION, whenever possible.
  • Try to avoid using the DISTINCT clause, whenever possible.
  • Try to avoid using SQL Server cursors, whenever possible.
  • Try to avoid the HAVING clause, whenever possible.
  • If you need to return the total table's row count, you can use alternative way instead of  SELECT COUNT(*) statement.
  • Include SET NOCOUNT ON statement into your stored procedures to stop the      message indicating the number of rows affected by a T-SQL statement.
  • Use the select statements with TOP keyword or the SET ROWCOUNT statement, if  you need to return only the first n rows.


Posted by Vidya Rani on Oct 14, 2011

Hi Amit,

It is a technique to tune your query in such a way, so it processes your request faster while interacting with database. 

 

Posted by uttam chaturvedi on Oct 13, 2011
Posted by Amol on Aug 29, 2011
Sponsored by

Become a Sponsor
PREMIUM SPONSORS
Sponsored by
Nevron Gauge for SharePoint
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.