<?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 for Real World DBA</title>
	<atom:link href="http://realworlddba.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://realworlddba.wordpress.com</link>
	<description>Making Life Easier for SQL Server DBAs</description>
	<lastBuildDate>Thu, 26 Nov 2009 22:51:11 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Deferred Name Resolution, or &#8220;Why does my proc allow invalid table names?&#8221; by kiviffnab</title>
		<link>http://realworlddba.wordpress.com/2008/06/04/deferred-name-resolution-or-why-does-my-proc-allow-invalid-table-names/#comment-45</link>
		<dc:creator>kiviffnab</dc:creator>
		<pubDate>Thu, 26 Nov 2009 22:51:11 +0000</pubDate>
		<guid isPermaLink="false">http://realworlddba.wordpress.com/?p=17#comment-45</guid>
		<description>Wow, I didn&#039;t heard about this topic up to the present. Cheers!</description>
		<content:encoded><![CDATA[<p>Wow, I didn&#8217;t heard about this topic up to the present. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Indexes &#8211; to Rebuild or Reorganize? by Dugi</title>
		<link>http://realworlddba.wordpress.com/2008/01/27/indexes-to-rebuild-or-reorganize/#comment-44</link>
		<dc:creator>Dugi</dc:creator>
		<pubDate>Mon, 24 Aug 2009 08:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://realworlddba.wordpress.com/?p=5#comment-44</guid>
		<description>In the script where we can retrieve the info about fragmentation is missing the table alias, so the script below is correct, if anyone have any problem during the run:

SELECT OBJECT_NAME(i.object_id) AS [Table Name],
i.name AS [Index Name],
dm.avg_fragmentation_in_percent, *
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, ‘DETAILED’) dm
INNER JOIN sys.indexes i ON i.object_id = dm.object_id
AND i.index_id = dm.index_id
order by dm.avg_fragmentation_in_percent desc

Anyway nice explanation and thnx for the infos!</description>
		<content:encoded><![CDATA[<p>In the script where we can retrieve the info about fragmentation is missing the table alias, so the script below is correct, if anyone have any problem during the run:</p>
<p>SELECT OBJECT_NAME(i.object_id) AS [Table Name],<br />
i.name AS [Index Name],<br />
dm.avg_fragmentation_in_percent, *<br />
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, ‘DETAILED’) dm<br />
INNER JOIN sys.indexes i ON i.object_id = dm.object_id<br />
AND i.index_id = dm.index_id<br />
order by dm.avg_fragmentation_in_percent desc</p>
<p>Anyway nice explanation and thnx for the infos!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Index Rebuild versus Reorganize: What&#8217;s the difference? by Anonymous</title>
		<link>http://realworlddba.wordpress.com/2008/02/04/index-rebuild-versus-reorganize-whats-the-difference/#comment-42</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 04 Jun 2009 10:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://realworlddba.wordpress.com/?p=11#comment-42</guid>
		<description>In SQL Server 2005, one can choose to either rebuild the index or re-organize the index. There are differences in what these commands do and it is important to understand those differences. At a very simple level, here is how you would re-organize or rebuild an index:

CREATE TABLE DECIPHER_DATA (COL1 INT, COL2 NVARCHAR(10));
CREATE UNIQUE INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA (COL2);

ALTER INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA REORGANIZE;
ALTER INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA REBUILD;

Here are the differences between the two:

1) Index rebuild works by re-creating the index internally again and when that has been achieved, it drops the existing index where as index reorganize is the process of physically re-organizing the leaf nodes of the index.

2) During the index rebuild process, the statistics are also re-computed – same as when a new index gets created. Reorganize on the other hand does not update the statistics. Reorganize essentially just swaps one page with another and thus does not require free space for this operation like rebuild does. Infact, reorganize can free up some pages as it does the reorg in two phases – compaction and defrag. A reorganize can remove almost all of the logical fragmentation but it cannot necessarily fix extent fragmentation in which the previous and the next extents are physically contiguous.

3) Another point to note is that an index (clustered or non-clustered) cannot be built online if it contains LOB data (text, ntext, varchar(max), nvarchar(max), varbinary(max), image and xml data type columns). The ALTER INDEX…REORGANIZE command shown above is the same as DBCC INDEXDEFRAG but there is one difference. ALTER INDEX…REORGANIZE has some additional features like large objects compaction (LOB_COMPACTION). And this is an online operation.

4) Regarding partitions of an index, if an index has multiple partitions, then you cannot rebuild a single partition online. You can reorganize a single index partition online. If you want to rebuild an index with multiple partitions in an online environment, you need to rebuild the entire index which means rebuilding all the partitions.

So, how frequently should one do the rebuild/reorganize? Like many answers in the IT field, it depends :-) It depends on the fillfactor, it depends upon the amount of the data that is changed between the rebuild/reorganize operations and it depends upon what logical fragmentation value you consider to be the threshold for forcing these operations.

An additional question that was raised by one of our colleagues was whether the statistics on non-indexed columns also get re-computed when a rebuild is done? He was talking about the auto create statistics (the ones that you would have seen with the names like _WA_sys_xxxx) or the ones that are explicitly created by using the create statistics command. If we are rebuilding an index, does it make sense to also rebuild those at the same time especially if there is any co-relation between them? Does that happen automatically upon a rebuild? The answer is no. It cannot happen automatically since the co-relation is not stored anywhere and those statistics are stored separately from those indexes. In SQL Server 2008, there is a DATE_CORRELATION_OPTIMIZATION database SET option which can help improve the performance of those queries in which 2 tables are in an inner join condition and whose date/datetime data-type columns are co-related example: PO_HDR might have ORDER_DATE and PO_DTL might have PACK_DATE, SHIP_DATE, DUE_DATE etc.. I will check to see whether a rebuild in that case forces the re-build on the co-related index as well and if no index exists, whether the stats are re-computed on those co-related columns if this option is on. Will post our results here once we are done with my tests</description>
		<content:encoded><![CDATA[<p>In SQL Server 2005, one can choose to either rebuild the index or re-organize the index. There are differences in what these commands do and it is important to understand those differences. At a very simple level, here is how you would re-organize or rebuild an index:</p>
<p>CREATE TABLE DECIPHER_DATA (COL1 INT, COL2 NVARCHAR(10));<br />
CREATE UNIQUE INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA (COL2);</p>
<p>ALTER INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA REORGANIZE;<br />
ALTER INDEX DECIPHER_DATA_IND_1 ON DECIPHER_DATA REBUILD;</p>
<p>Here are the differences between the two:</p>
<p>1) Index rebuild works by re-creating the index internally again and when that has been achieved, it drops the existing index where as index reorganize is the process of physically re-organizing the leaf nodes of the index.</p>
<p>2) During the index rebuild process, the statistics are also re-computed – same as when a new index gets created. Reorganize on the other hand does not update the statistics. Reorganize essentially just swaps one page with another and thus does not require free space for this operation like rebuild does. Infact, reorganize can free up some pages as it does the reorg in two phases – compaction and defrag. A reorganize can remove almost all of the logical fragmentation but it cannot necessarily fix extent fragmentation in which the previous and the next extents are physically contiguous.</p>
<p>3) Another point to note is that an index (clustered or non-clustered) cannot be built online if it contains LOB data (text, ntext, varchar(max), nvarchar(max), varbinary(max), image and xml data type columns). The ALTER INDEX…REORGANIZE command shown above is the same as DBCC INDEXDEFRAG but there is one difference. ALTER INDEX…REORGANIZE has some additional features like large objects compaction (LOB_COMPACTION). And this is an online operation.</p>
<p>4) Regarding partitions of an index, if an index has multiple partitions, then you cannot rebuild a single partition online. You can reorganize a single index partition online. If you want to rebuild an index with multiple partitions in an online environment, you need to rebuild the entire index which means rebuilding all the partitions.</p>
<p>So, how frequently should one do the rebuild/reorganize? Like many answers in the IT field, it depends <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It depends on the fillfactor, it depends upon the amount of the data that is changed between the rebuild/reorganize operations and it depends upon what logical fragmentation value you consider to be the threshold for forcing these operations.</p>
<p>An additional question that was raised by one of our colleagues was whether the statistics on non-indexed columns also get re-computed when a rebuild is done? He was talking about the auto create statistics (the ones that you would have seen with the names like _WA_sys_xxxx) or the ones that are explicitly created by using the create statistics command. If we are rebuilding an index, does it make sense to also rebuild those at the same time especially if there is any co-relation between them? Does that happen automatically upon a rebuild? The answer is no. It cannot happen automatically since the co-relation is not stored anywhere and those statistics are stored separately from those indexes. In SQL Server 2008, there is a DATE_CORRELATION_OPTIMIZATION database SET option which can help improve the performance of those queries in which 2 tables are in an inner join condition and whose date/datetime data-type columns are co-related example: PO_HDR might have ORDER_DATE and PO_DTL might have PACK_DATE, SHIP_DATE, DUE_DATE etc.. I will check to see whether a rebuild in that case forces the re-build on the co-related index as well and if no index exists, whether the stats are re-computed on those co-related columns if this option is on. Will post our results here once we are done with my tests</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SQL UPSERT by Anonymous</title>
		<link>http://realworlddba.wordpress.com/2008/01/31/sql-upsert/#comment-41</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 09 Feb 2009 21:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://realworlddba.wordpress.com/?p=9#comment-41</guid>
		<description>Upsert is a much harder then problem then this would imply.  Consider two simultaneous updates, both fail, because the record does not exist yet.  Both attempt to insert, but one fails.

You can use a heavy isolation to solve, but in general that is a very heavyweight solution.  I tend to code with the possibility for a failure on the insert and then retry the update.</description>
		<content:encoded><![CDATA[<p>Upsert is a much harder then problem then this would imply.  Consider two simultaneous updates, both fail, because the record does not exist yet.  Both attempt to insert, but one fails.</p>
<p>You can use a heavy isolation to solve, but in general that is a very heavyweight solution.  I tend to code with the possibility for a failure on the insert and then retry the update.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on About by Carl Williams</title>
		<link>http://realworlddba.wordpress.com/about/#comment-27</link>
		<dc:creator>Carl Williams</dc:creator>
		<pubDate>Wed, 16 Jul 2008 21:27:16 +0000</pubDate>
		<guid isPermaLink="false">#comment-27</guid>
		<description>Hello:

My name is Carl Williams from OdinJobs.com, a career enhancement portal for IT professionals. We need your help and opinion for an upcoming article that looks at practicing Sql Server DBA &amp; developer and their work day.

Your blog, Real World DBA,is a great resource for SQL Server professionals and your views and opinions will be of great value to our readers (IT folks).

Having an expert like you as part of this article will be an honor and privilege. Hope you can  take a few minutes off your busy schedule and help our readers improve their career.

1.How and when were you introduced to SQL Server?

2.What is the most stressful part of your job when working with SQL Server?

3.Production DBA, Development DBA and SQL Server Developer – Are these roles inter-changeable or do you think that each role is specialized, that there is little chance of crossover?

4.Name 2 exciting, new SQL Server features either in SQL Server 2008 or is upcoming.

5.What do you recommend to others for keeping track of whats happening in SQL Server?

6.Whats a SQL Server MVP and what does it take to become one?

7.Whats the next logical career step for you?

8.Why would you recommend SQL Server vis-a-vis other databases?</description>
		<content:encoded><![CDATA[<p>Hello:</p>
<p>My name is Carl Williams from OdinJobs.com, a career enhancement portal for IT professionals. We need your help and opinion for an upcoming article that looks at practicing Sql Server DBA &amp; developer and their work day.</p>
<p>Your blog, Real World DBA,is a great resource for SQL Server professionals and your views and opinions will be of great value to our readers (IT folks).</p>
<p>Having an expert like you as part of this article will be an honor and privilege. Hope you can  take a few minutes off your busy schedule and help our readers improve their career.</p>
<p>1.How and when were you introduced to SQL Server?</p>
<p>2.What is the most stressful part of your job when working with SQL Server?</p>
<p>3.Production DBA, Development DBA and SQL Server Developer – Are these roles inter-changeable or do you think that each role is specialized, that there is little chance of crossover?</p>
<p>4.Name 2 exciting, new SQL Server features either in SQL Server 2008 or is upcoming.</p>
<p>5.What do you recommend to others for keeping track of whats happening in SQL Server?</p>
<p>6.Whats a SQL Server MVP and what does it take to become one?</p>
<p>7.Whats the next logical career step for you?</p>
<p>8.Why would you recommend SQL Server vis-a-vis other databases?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Indexes &#8211; to Rebuild or Reorganize? by Ola Hallengren</title>
		<link>http://realworlddba.wordpress.com/2008/01/27/indexes-to-rebuild-or-reorganize/#comment-11</link>
		<dc:creator>Ola Hallengren</dc:creator>
		<pubDate>Fri, 14 Mar 2008 00:02:54 +0000</pubDate>
		<guid isPermaLink="false">http://realworlddba.wordpress.com/?p=5#comment-11</guid>
		<description>Thanks, Mxhxrdba. I would like to share a solution that I’ve made that works a little differently. It does index rebuild online or offline, index reorganization, statistics update, index reorganization and statistics update or nothing based on fragmentation level and lob existence.

http://blog.ola.hallengren.com/blog/_archives/2008/1/1/3440068.html
http://blog.ola.hallengren.com/_attachments/3440068/Documentation.html
http://blog.ola.hallengren.com/_attachments/3440068/IndexOptimize.sql

Ola Hallengren
http://ola.hallengren.com</description>
		<content:encoded><![CDATA[<p>Thanks, Mxhxrdba. I would like to share a solution that I’ve made that works a little differently. It does index rebuild online or offline, index reorganization, statistics update, index reorganization and statistics update or nothing based on fragmentation level and lob existence.</p>
<p><a href="http://blog.ola.hallengren.com/blog/_archives/2008/1/1/3440068.html" rel="nofollow">http://blog.ola.hallengren.com/blog/_archives/2008/1/1/3440068.html</a><br />
<a href="http://blog.ola.hallengren.com/_attachments/3440068/Documentation.html" rel="nofollow">http://blog.ola.hallengren.com/_attachments/3440068/Documentation.html</a><br />
<a href="http://blog.ola.hallengren.com/_attachments/3440068/IndexOptimize.sql" rel="nofollow">http://blog.ola.hallengren.com/_attachments/3440068/IndexOptimize.sql</a></p>
<p>Ola Hallengren<br />
<a href="http://ola.hallengren.com" rel="nofollow">http://ola.hallengren.com</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
