<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Optimization Rules of Thumb &#8211; Best Practices</title>
	<atom:link href="http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Eric Russell</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-36056</link>
		<dc:creator><![CDATA[Eric Russell]]></dc:creator>
		<pubDate>Wed, 30 Apr 2008 14:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-36056</guid>
		<description><![CDATA[Remember that many performance problems cannot be reproduced in your development environment, and examining the issue in the production environment is essential. When users report a performance problem, use SQL Server Profiler to insure you are attempting to optimize the correct procedure, and determne exactly how much time and resources it is comsuming. This can later be used a benchmark to measure how much improvement (if any) your attempts at performance optimization have made.  
Also, if users report that a database operation, which normally runs within an acceptable amount of time, will sporatically run for significantly longer, use sp_who2 or server traces to determine if process blocking is at the root of the problem and then what conditions (available memory, another process that competes for the same resources, etc.) contribute to the blocking.]]></description>
		<content:encoded><![CDATA[<p>Remember that many performance problems cannot be reproduced in your development environment, and examining the issue in the production environment is essential. When users report a performance problem, use SQL Server Profiler to insure you are attempting to optimize the correct procedure, and determne exactly how much time and resources it is comsuming. This can later be used a benchmark to measure how much improvement (if any) your attempts at performance optimization have made.<br />
Also, if users report that a database operation, which normally runs within an acceptable amount of time, will sporatically run for significantly longer, use sp_who2 or server traces to determine if process blocking is at the root of the problem and then what conditions (available memory, another process that competes for the same resources, etc.) contribute to the blocking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - Optimization Rules of Thumb - Best Practices - Reader&#8217;s Article Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35834</link>
		<dc:creator><![CDATA[SQL SERVER - Optimization Rules of Thumb - Best Practices - Reader&#8217;s Article Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Mon, 28 Apr 2008 15:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35834</guid>
		<description><![CDATA[[...] 26, 2008 by pinaldave    This article has been written by blog reader and SQL Server Expert Praveen Barath in response to my previous article SQL SERVER - Optimization Rules of Thumb - Best [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 26, 2008 by pinaldave    This article has been written by blog reader and SQL Server Expert Praveen Barath in response to my previous article SQL SERVER &#8211; Optimization Rules of Thumb &#8211; Best [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen Barath</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35827</link>
		<dc:creator><![CDATA[Praveen Barath]]></dc:creator>
		<pubDate>Mon, 28 Apr 2008 12:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35827</guid>
		<description><![CDATA[Well Query Optimizations rules are not limited. 
It depends on business needs as well,

 For example we always suggest to have a relationship between tables but if they are heavily used for Update insert delete, I personally don’t recommended coz it will effect performance as I mentioned it all depends on Business needs;

Here are few more tips I hope will help you to understand.



One: only &quot;tune&quot; SQL after code is confirmed as working correctly. 
(use top (sqlServer) and LIMIT to limit the number of results where appropriate,
SELECT top 10 jim,sue,avril FROM dbo.names )

 Two: ensure repeated SQL statements are written absolutely identically to facilate efficient reuse: re-parsing can often be avoided for each subsequent use. 


 Three: code the query as simply as possible i.e. no unnecessary columns are selected, no unnecessary GROUP BY or ORDER BY. 

 Four: it is the same or faster to SELECT by actual column name(s). The larger the table the more likely the savings. 

 Five: do not perform operations on DB objects referenced in the WHERE clause: 

 Six: avoid a HAVING clause in SELECT statements - it only filters selected rows after all the rows have been returned. Use HAVING only when summary operations applied to columns will be restricted by the clause. A WHERE clause may be more efficient. 

 Seven: when writing a sub-query (a SELECT statement within the WHERE or HAVING clause of another SQL statement): 
-- use a correlated (refers to at least one value from the outer query) sub-query when the return is relatively small and/or other criteria are efficient i.e. if the tables within the sub-query have efficient indexes. 
-- use a noncorrelated (does not refer to the outer query) sub-query when dealing with large tables from which you expect a large return (many rows) and/or if the tables within the sub-query do not have efficient indexes. 
-- ensure that multiple sub-queries are in the most efficient order. 
-- remember that rewriting a sub-query as a join can sometimes increase efficiency. 

Eight: minimize the number of table lookups especially if there are sub-query SELECTs or multicolumn UPDATEs. 
 
Nine: when doing multiple table joins consider the benefits/costs for each of EXISTS, IN, and table joins. Depending on your data one or another may be faster. 
‘IN is usually the slowest’. 
Note: when most of the filter criteria are in the sub-query IN may be more efficient; when most of the filter criteria are in the parent-query EXISTS may be more efficient. 

Ten: where possible use EXISTS rather than DISTINCT. 


Praveen Barath]]></description>
		<content:encoded><![CDATA[<p>Well Query Optimizations rules are not limited.<br />
It depends on business needs as well,</p>
<p> For example we always suggest to have a relationship between tables but if they are heavily used for Update insert delete, I personally don’t recommended coz it will effect performance as I mentioned it all depends on Business needs;</p>
<p>Here are few more tips I hope will help you to understand.</p>
<p>One: only &#8220;tune&#8221; SQL after code is confirmed as working correctly.<br />
(use top (sqlServer) and LIMIT to limit the number of results where appropriate,<br />
SELECT top 10 jim,sue,avril FROM dbo.names )</p>
<p> Two: ensure repeated SQL statements are written absolutely identically to facilate efficient reuse: re-parsing can often be avoided for each subsequent use. </p>
<p> Three: code the query as simply as possible i.e. no unnecessary columns are selected, no unnecessary GROUP BY or ORDER BY. </p>
<p> Four: it is the same or faster to SELECT by actual column name(s). The larger the table the more likely the savings. </p>
<p> Five: do not perform operations on DB objects referenced in the WHERE clause: </p>
<p> Six: avoid a HAVING clause in SELECT statements &#8211; it only filters selected rows after all the rows have been returned. Use HAVING only when summary operations applied to columns will be restricted by the clause. A WHERE clause may be more efficient. </p>
<p> Seven: when writing a sub-query (a SELECT statement within the WHERE or HAVING clause of another SQL statement):<br />
&#8211; use a correlated (refers to at least one value from the outer query) sub-query when the return is relatively small and/or other criteria are efficient i.e. if the tables within the sub-query have efficient indexes.<br />
&#8211; use a noncorrelated (does not refer to the outer query) sub-query when dealing with large tables from which you expect a large return (many rows) and/or if the tables within the sub-query do not have efficient indexes.<br />
&#8211; ensure that multiple sub-queries are in the most efficient order.<br />
&#8211; remember that rewriting a sub-query as a join can sometimes increase efficiency. </p>
<p>Eight: minimize the number of table lookups especially if there are sub-query SELECTs or multicolumn UPDATEs. </p>
<p>Nine: when doing multiple table joins consider the benefits/costs for each of EXISTS, IN, and table joins. Depending on your data one or another may be faster.<br />
‘IN is usually the slowest’.<br />
Note: when most of the filter criteria are in the sub-query IN may be more efficient; when most of the filter criteria are in the parent-query EXISTS may be more efficient. </p>
<p>Ten: where possible use EXISTS rather than DISTINCT. </p>
<p>Praveen Barath</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hitesh</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35777</link>
		<dc:creator><![CDATA[Hitesh]]></dc:creator>
		<pubDate>Mon, 28 Apr 2008 00:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35777</guid>
		<description><![CDATA[A lot depends on the usage of the DB - if low data updates and high volume of queries, create a covering index for the most  highly used queries since data can be obtainied directly from the index and no lookup to the data table needs to be done.

If possible, store indexes on a separate drive than from the data files.]]></description>
		<content:encoded><![CDATA[<p>A lot depends on the usage of the DB &#8211; if low data updates and high volume of queries, create a covering index for the most  highly used queries since data can be obtainied directly from the index and no lookup to the data table needs to be done.</p>
<p>If possible, store indexes on a separate drive than from the data files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Red Bull</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35599</link>
		<dc:creator><![CDATA[Red Bull]]></dc:creator>
		<pubDate>Fri, 25 Apr 2008 20:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35599</guid>
		<description><![CDATA[Rule # 7 : Avoid SP names that begin with sp_
Rule # 8 : Use SET NOCOUNT ON, where ever possible]]></description>
		<content:encoded><![CDATA[<p>Rule # 7 : Avoid SP names that begin with sp_<br />
Rule # 8 : Use SET NOCOUNT ON, where ever possible</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luciano Evaristo Guerche (Gorše)</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35581</link>
		<dc:creator><![CDATA[Luciano Evaristo Guerche (Gorše)]]></dc:creator>
		<pubDate>Fri, 25 Apr 2008 15:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35581</guid>
		<description><![CDATA[My Rule # 7 would be: Ensure there aren&#039;t missing or outdated statistics

--
Luciano Evaristo Guerche (Gorše)
Taboão da Serra, SP, Brazil]]></description>
		<content:encoded><![CDATA[<p>My Rule # 7 would be: Ensure there aren&#8217;t missing or outdated statistics</p>
<p>&#8211;<br />
Luciano Evaristo Guerche (Gorše)<br />
Taboão da Serra, SP, Brazil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PP</title>
		<link>http://blog.sqlauthority.com/2008/04/25/sql-server-optimization-rules-of-thumb-best-practices/#comment-35540</link>
		<dc:creator><![CDATA[PP]]></dc:creator>
		<pubDate>Fri, 25 Apr 2008 04:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=582#comment-35540</guid>
		<description><![CDATA[#7 -- Better to have a THIN Index over FAT Index. If Index is on BIG Varchar column see if those can be substituted to INT column]]></description>
		<content:encoded><![CDATA[<p>#7 &#8212; Better to have a THIN Index over FAT Index. If Index is on BIG Varchar column see if those can be substituted to INT column</p>
]]></content:encoded>
	</item>
</channel>
</rss>

