<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Paulo&#039;s Weblog</title>
	<atom:link href="http://netic.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://netic.wordpress.com</link>
	<description>Just another module from my kernel…</description>
	<lastBuildDate>Wed, 28 Oct 2009 17:39:08 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='netic.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/10dafdc5052f806666d218c9b21a8e29?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Paulo&#039;s Weblog</title>
		<link>http://netic.wordpress.com</link>
	</image>
			<item>
		<title>SSMS (SQL SERVER MANAGEMENT STUDIO) slow startup &#8211; solved</title>
		<link>http://netic.wordpress.com/2009/10/28/ssms-sql-server-management-studio-slow-startup-solved/</link>
		<comments>http://netic.wordpress.com/2009/10/28/ssms-sql-server-management-studio-slow-startup-solved/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 17:06:12 +0000</pubDate>
		<dc:creator>Paulo Condeça</dc:creator>
				<category><![CDATA[SQLSERVER]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[SSMS]]></category>

		<guid isPermaLink="false">http://netic.wordpress.com/?p=28</guid>
		<description><![CDATA[SSMS (SQL SERVER MANAGEMENT STUDIO) slow startup and how to optimize SSMS startup time :
To sump up, everytime you open SSMS it will check some certs, so, do the following if you want faster load times :
Open IE &#62; TOOLS &#62; OPTIONS &#62; ADVANCED &#62; UNCHECK PUBLISHER CERTIFICATE REVOCATION .
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=28&subd=netic&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>SSMS (SQL SERVER MANAGEMENT STUDIO) slow startup and how to optimize SSMS startup time :<br />
To sump up, everytime you open SSMS it will check some certs, so, do the following if you want faster load times :</p>
<p>Open IE &gt; TOOLS &gt; OPTIONS &gt; ADVANCED &gt; UNCHECK PUBLISHER CERTIFICATE REVOCATION .</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/netic.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/netic.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/netic.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/netic.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/netic.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/netic.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/netic.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/netic.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/netic.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/netic.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=28&subd=netic&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://netic.wordpress.com/2009/10/28/ssms-sql-server-management-studio-slow-startup-solved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a02d019603fa7ac617f49043696f2fce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Netic</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple command to get Linux disk usage by dir</title>
		<link>http://netic.wordpress.com/2009/10/28/simple-command-to-get-linux-disk-usage-by-dir/</link>
		<comments>http://netic.wordpress.com/2009/10/28/simple-command-to-get-linux-disk-usage-by-dir/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 13:19:18 +0000</pubDate>
		<dc:creator>Paulo Condeça</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://netic.wordpress.com/2009/10/28/simple-command-to-get-linux-disk-usage-by-dir/</guid>
		<description><![CDATA[This is a simple and practical command to get disk usage by dir in Linux -&#62; du -sh *
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=26&subd=netic&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is a simple and practical command to get disk usage by dir in Linux -&gt; <code>du -sh *</code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/netic.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/netic.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/netic.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/netic.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/netic.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/netic.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/netic.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/netic.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/netic.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/netic.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=26&subd=netic&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://netic.wordpress.com/2009/10/28/simple-command-to-get-linux-disk-usage-by-dir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a02d019603fa7ac617f49043696f2fce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Netic</media:title>
		</media:content>
	</item>
		<item>
		<title>Analyzing SQL SERVER 2005 LONG RUNNING QUERIES</title>
		<link>http://netic.wordpress.com/2008/08/11/analyzing-sql-server-2005-long-running-queries/</link>
		<comments>http://netic.wordpress.com/2008/08/11/analyzing-sql-server-2005-long-running-queries/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:58:08 +0000</pubDate>
		<dc:creator>Paulo Condeça</dc:creator>
				<category><![CDATA[SQLSERVER]]></category>
		<category><![CDATA[BOTTLENECK]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[TUNING]]></category>

		<guid isPermaLink="false">http://netic.wordpress.com/?p=10</guid>
		<description><![CDATA[I&#8217;m leaving this tip for you to find what exactly is running on sql server.
SELECT r.session_id, s.HOST_NAME, s.PROGRAM_NAME,
s.host_process_id, r.status, r.wait_time,
wait_type, r.wait_resource,
SUBSTRING(qt.text,(r.statement_start_offset/2) +1,
(CASE WHEN r.statement_end_offset = -1
THEN LEN(CONVERT(nvarchar(max), qt.text)) * 2
ELSE r.statement_end_offset
END -r.statement_start_offset)/2)
AS stmt_executing,r.blocking_session_id,
r.cpu_time,r.total_elapsed_time,r.reads,r.writes,
r.logical_reads, r.plan_handle
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(sql_handle) as qt, sys.dm_exec_sessions s
WHERE r.session_id &#62; 50 and r.session_id=s.session_id
ORDER BY r.session_id, s.host_name, s.program_name, r.status
    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=10&subd=netic&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m leaving this tip for you to find what exactly is running on sql server.</p>
<p>SELECT r.session_id, s.HOST_NAME, s.PROGRAM_NAME,<br />
s.host_process_id, r.status, r.wait_time,<br />
wait_type, r.wait_resource,<br />
SUBSTRING(qt.text,(r.statement_start_offset/2) +1,<br />
(CASE WHEN r.statement_end_offset = -1</p>
<p>THEN LEN(CONVERT(nvarchar(max), qt.text)) * 2</p>
<p>ELSE r.statement_end_offset</p>
<p>END -r.statement_start_offset)/2)</p>
<p>AS stmt_executing,r.blocking_session_id,<br />
r.cpu_time,r.total_elapsed_time,r.reads,r.writes,<br />
r.logical_reads, r.plan_handle</p>
<p>FROM sys.dm_exec_requests r</p>
<p>CROSS APPLY sys.dm_exec_sql_text(sql_handle) as qt, sys.dm_exec_sessions s</p>
<p>WHERE r.session_id &gt; 50 and r.session_id=s.session_id<br />
ORDER BY r.session_id, s.host_name, s.program_name, r.status</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/netic.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/netic.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/netic.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/netic.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/netic.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/netic.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/netic.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/netic.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/netic.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/netic.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/netic.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/netic.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=10&subd=netic&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://netic.wordpress.com/2008/08/11/analyzing-sql-server-2005-long-running-queries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a02d019603fa7ac617f49043696f2fce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Netic</media:title>
		</media:content>
	</item>
		<item>
		<title>MICROSOFT SQL SERVER 2005 Partitioning (English Version)</title>
		<link>http://netic.wordpress.com/2008/08/11/microsoft-sql-server-2005-partitioning-english-version/</link>
		<comments>http://netic.wordpress.com/2008/08/11/microsoft-sql-server-2005-partitioning-english-version/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:52:59 +0000</pubDate>
		<dc:creator>Paulo Condeça</dc:creator>
				<category><![CDATA[SQLSERVER]]></category>
		<category><![CDATA[DATAWAREHOUSE]]></category>
		<category><![CDATA[PARTITIONING]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[SCALABILITY]]></category>
		<category><![CDATA[TUNING]]></category>

		<guid isPermaLink="false">http://netic.wordpress.com/?p=8</guid>
		<description><![CDATA[SQL SERVER 2005 Partitioning &#60;- Can read a fully formated .doc in here .


Microsoft worked well in the Microsoft SQL Server 2005 (even better in MSSQL Server 2008), bringing a shine to their RDBMS engine and building it to be a real Enterprise Class Product.
I’m not going to write about all the new features of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=8&subd=netic&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div id="result_box" dir="ltr"><a href="http://netic.files.wordpress.com/2008/08/techwriting1-sqlserver2005partitioning.doc">SQL SERVER 2005 Partitioning</a> &lt;- Can read a fully formated .doc in here .</div>
<div dir="ltr">
<div>
<p><span style="font-size:x-small;font-family:Verdana;">Microsoft worked well in the Microsoft SQL Server 2005 (even better in MSSQL Server 2008), bringing a shine to their RDBMS engine and building it to be a real Enterprise Class Product.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">I’m not going to write about all the new features of the OLTP Engine, I will focus this article on Database Partition, giving you a real case scenario.</span></p>
<p><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">I. Benefits and Limitations of Partitioning (HEAPS/CLUSTERED/NONCLUSTERED). </span></p>
<p><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">II. Implementation Methodology. </span><span style="font-size:x-small;font-family:Verdana;"> <br />
 <br />
</span><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">III. Partitioning Management.</span><span style="font-size:x-small;font-family:Verdana;">  <br />
</span></p>
<p><span style="font-size:x-small;font-family:Verdana;"> <br />
</span><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">I. Benefits and Limitations of Partitioning (HEAPS/CLUSTERED/NONCLUSTERED):</span><span style="font-size:x-small;font-family:Verdana;"> <br />
 <br />
</span><span style="font-size:small;color:#0000ff;font-family:Verdana;"><strong>+</strong></span><span style="font-size:x-small;font-family:Verdana;"> <br />
 <br />
Data can be accessed through multiple partitions in parallel, this will results in faster DML.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Different partitions can be managed separately.  <br />
 <br />
Management of history more efficient (without having to leave the table).  <br />
 <br />
</span><span style="font-size:small;color:#ff0000;font-family:Verdana;"><strong>-</strong></span><span style="font-size:x-small;font-family:Verdana;"> <br />
 <br />
Limit of 1000 Partitions by Table. </span></p>
<p><span style="font-size:x-small;font-family:Verdana;"> <br />
Inability to use Indexed Views.  <br />
</span> </p>
<p><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">II. Implementation Methodology.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">I’m going to focus in the most common scenario:</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Typically, in a DW environment there is a large Fact Table (<em>a.k.a the Monster</em>).</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">In this article the Fact Table contains all the banking movements of all accounts within the last 4 years in the <em>MAIN</em> database and the remaining years in a <em>HISTORY</em> database.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">In this case, because there is a <em>chronology</em> to follow, I will use the extract day date column of the table as the <em>KEY</em> to our <em>Partition Strategy</em>.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">In this situation, I recommend the creation of a <strong><em>Partitioned Clustered Index</em></strong> because typically all access to the fact table always has the date in the <em>SARG.</em>  <br />
</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">The fact table will be partitioned by month. <br />
</span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Technical approach:  <br />
</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Storage Arquitecture &#8211; <strong>3</strong> <em>RAID-5</em> Partition (2TB each), <strong>1</strong> <em>RAID 01</em> for Transaction Log and <strong>1</strong> more <em>RAID 01</em> for Non-Clustered indexes.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">First off all you will need to develop the <em>Partition Function</em>.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">The <em>Partition Function defines the values which the partition scheme will bind with the Filegroups.</em> </span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Our boundary will be the date, and right <em>range(</em>boundary right <em>aligned)</em>.</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">CREATE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PARTITION</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FUNCTION</span><span style="font-size:xx-small;font-family:Verdana;"> PFFactTableMonthly </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">SMALLDATETIME</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">AS</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">RANGE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">RIGHT</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FOR</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">VALUES</span><span style="font-size:xx-small;font-family:Verdana;"> </span></p>
<ul>     <span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span></ul>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-01-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-02-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-03-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-04-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-05-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-06-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-07-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-08-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-09-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-10-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-11-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2007-12-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-01-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-02-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-03-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-04-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-05-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-06-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-07-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-08-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-09-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-10-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-11-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2008-12-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2009-01-01&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>            <span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2009-02-01&#8242;</span></p>
<p>            <span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span></p>
<p><span style="font-size:x-small;font-family:Verdana;"> <br />
Create the Datafiles and assign each file to a differente Filegroup. In this situation <strong>27</strong> Datafiles/Filegroups will be created. </span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Now that the Filegroups are created, assign them to a <em>Partition Scheme that </em>acts like a <em>ROUTER,</em> because it will forward the data to a specified path.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">The <em>Partition Scheme</em> will use the <em>Partition Function </em>to link the <em>logical layer to the physical layer.</em></span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">CREATE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PARTITION</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">SCHEME</span><span style="font-size:xx-small;font-family:Verdana;"> PSFactTableMonthly</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">AS</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PARTITION</span><span style="font-size:xx-small;font-family:Verdana;"> PFFactTableMonthly</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">TO</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_BASE</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200701</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200702</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200703</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200704</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200705</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200706</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200707</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200708</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200709</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200710</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200711</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200712</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200801</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200802</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200803</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200804</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200805</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200806</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200807</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200808</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200809</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200810</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200811</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200812</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200901</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200902</span></p>
<p>      <span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Now that we have the <em>Partition Scheme</em>, just create the <em>Clustered Index </em>on the Fact table with a FILLFACTOR 90% with PAD_INDEX on. </span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">CREATE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">CLUSTERED</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">INDEX</span><span style="font-size:xx-small;font-family:Verdana;"> [IDXC_FACTTABLE] </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ON</span><span style="font-size:xx-small;font-family:Verdana;"> MIS</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;">FACTTABLE</span></p>
<p>      <span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span></p>
<p>      <span style="font-size:xx-small;font-family:Verdana;">datecolumn</span></p>
<p>      <span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span><span style="font-size:xx-small;font-family:Verdana;"> </span></p>
<p>      <span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">WITH</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PAD_INDEX</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ON</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FILLFACTOR</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> 90</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">STATISTICS_NORECOMPUTE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">OFF</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span></p>
<p>      <span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">IGNORE_DUP_KEY</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">OFF</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ALLOW_ROW_LOCKS</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ON</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ALLOW_PAGE_LOCKS</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ON</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span><span style="font-size:xx-small;font-family:Verdana;"> </span> </p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">on</span><span style="font-size:xx-small;font-family:Verdana;"> PSFactTableMonthly </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span><span style="font-size:xx-small;font-family:Verdana;">DATECOLUMN</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span> </p>
<p><span style="font-size:x-small;color:#3366ff;font-family:Verdana;">III. Partitioning Management.</span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Now, that our table is partitioned, you are wondering, what will happen if there is an insert that has a date &gt;= </span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;2009-03-01&#8242;</span><span style="font-size:x-small;font-family:Verdana;">, what will happen is that all the data will be placed in the </span><span style="font-size:xx-small;font-family:Verdana;">FG_FactTable_200902 </span><span style="font-size:x-small;font-family:Verdana;">s because the data is <em>right</em> aligned as specified when we created the <em>Partition Function</em>.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">To maintain the data equally distributed between Filegroups, you must plan the future growth of you Database and continue adding Filegroups to the <em>Partition Scheme</em> and continuing to add <em>dates</em> to the <em>Partition Function</em>.</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Add a FG to the Partition Scheme:</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ALTER</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PARTITION</span><span style="font-size:xx-small;font-family:Verdana;"> PSFactTableMonthly </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">SCHEME</span><span style="font-size:xx-small;font-family:Verdana;"> </span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">NEXT</span><span style="font-size:xx-small;font-family:Verdana;"> USED [FG_FactTable_200903]</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;"> </span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Add a new boundary to the Partition Function:</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">ALTER</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">PARTITION</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FUNCTION</span><span style="font-size:xx-small;font-family:Verdana;"> PFFactTableMonthly</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;"> ()</span></p>
<p><span style="font-size:xx-small;font-family:Verdana;">SPLIT </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">RANGE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">(</span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;20090301&#8242;</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">)</span><span style="font-size:xx-small;font-family:Verdana;"> </span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Know the detail about the Partition Function :</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">SELECT</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">*</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FROM</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#008000;font-family:Verdana;">sys.partition_functions</span><span style="font-size:xx-small;font-family:Verdana;"> </span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">WHERE</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">name</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;PFFactTableMonthly&#8217;</span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Show the boundaries of the Partition Function :</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">SELECT</span><span style="font-size:xx-small;font-family:Verdana;"> a</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;">name</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> b</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.*</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">FROM</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#008000;font-family:Verdana;">sys.partition_functions</span><span style="font-size:xx-small;font-family:Verdana;"> a</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">,</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#008000;font-family:Verdana;">sys.partition_range_values</span><span style="font-size:xx-small;font-family:Verdana;"> b</span></p>
<p><span style="font-size:xx-small;color:#0000ff;font-family:Verdana;">WHERE</span><span style="font-size:xx-small;font-family:Verdana;"> a</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;">function_id </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> b</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;">function_id </span></p>
<p><span style="font-size:xx-small;color:#808080;font-family:Verdana;">and</span><span style="font-size:xx-small;font-family:Verdana;"> a</span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">.</span><span style="font-size:xx-small;font-family:Verdana;">name </span><span style="font-size:xx-small;color:#808080;font-family:Verdana;">=</span><span style="font-size:xx-small;font-family:Verdana;"> </span><span style="font-size:xx-small;color:#ff0000;font-family:Verdana;">&#8216;PFFactTableMonthly&#8217;</span></p>
<p><span style="font-size:x-small;font-family:Verdana;">Show Allocation Units</span></p>
<p><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">SELECT</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_name</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">name</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">    partition_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> partition_number </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> pnum</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">rows</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">    allocation_unit_id </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> au_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> type_desc </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">as</span><span style="font-size:x-small;font-family:Courier New;"> page_type_desc</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">    total_pages </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> pages</span></p>
<p><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">FROM</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.partitions</span><span style="font-size:x-small;font-family:Courier New;"> p </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.allocation_units</span><span style="font-size:x-small;font-family:Courier New;"> a</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">   </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> a</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">container_id</span></p>
<p><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">WHERE</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;color:#ff0000;font-family:Courier New;">&#8217;schema.FactTable</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span> <br />
 <br />
 <br />
 <br />
 <br />
 </p>
<p><span style="font-size:x-small;font-family:Verdana;">From my point of view this is the best statement there is available to have a neat overview of your partitioned table, because it shows the INDEX_ID, Partition_Number, Filegroup that is associated the respective Partition_Number, ROWS, PAGES and the date that is associated with the FileGroup.</span> </p>
<p><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">SELECT</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">OBJECT_NAME</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;font-family:Courier New;">i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">as</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">Object_Name</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></p>
<p>            <span style="font-size:x-small;font-family:Courier New;">i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">index_id </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> Index_ID</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">         p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_number</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span></p>
<ul>
<li> 
<ul><span style="font-size:x-small;font-family:Courier New;">fg</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">name </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">Filegroup_Name</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span></ul>
</li>
</ul>
<ul>
<li> 
<ul><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">rows</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span></ul>
</li>
</ul>
<ul>
<li> 
<ul><span style="font-size:x-small;font-family:Courier New;">au</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">total_pages</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span></ul>
</li>
</ul>
<p><span style="font-size:x-small;font-family:Courier New;">         </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">CASE</span><span style="font-size:x-small;font-family:Courier New;"> boundary_value_on_right</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">             </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">WHEN</span><span style="font-size:x-small;font-family:Courier New;"> 1 </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">THEN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff0000;font-family:Courier New;">&#8216;less than&#8217;</span></p>
<ul>
<li> 
<ul><span style="font-size:x-small;font-family:Courier New;">      </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ELSE</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff0000;font-family:Courier New;">&#8216;less than or equal to&#8217;</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">END</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">as</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff0000;font-family:Courier New;">&#8216;comparison&#8217;</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">value</span></ul>
</li>
</ul>
<ul><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">FROM</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.partitions</span><span style="font-size:x-small;font-family:Courier New;"> p </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.indexes</span><span style="font-size:x-small;font-family:Courier New;"> i</span></ul>
<p><span style="font-size:x-small;font-family:Courier New;">      </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">and</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">index_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">index_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">       </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.partition_schemes</span><span style="font-size:x-small;font-family:Courier New;"> ps</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> ps</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">data_space_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">data_space_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">       </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.partition_functions</span><span style="font-size:x-small;font-family:Courier New;"> f</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                   </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> f</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">function_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> ps</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">function_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">       </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">LEFT</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.partition_range_values</span><span style="font-size:x-small;font-family:Courier New;"> rv</span></p>
<p>     <span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> f</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">function_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> rv</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">function_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                    </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">AND</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_number </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> rv</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">boundary_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">     </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.destination_data_spaces</span><span style="font-size:x-small;font-family:Courier New;"> dds</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">             </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> dds</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_scheme_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> ps</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">data_space_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                  </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">AND</span><span style="font-size:x-small;font-family:Courier New;"> dds</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">destination_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_number</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">     </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.filegroups</span><span style="font-size:x-small;font-family:Courier New;"> fg</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> dds</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">data_space_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> fg</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">data_space_id</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">     </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">JOIN</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">SELECT</span><span style="font-size:x-small;font-family:Courier New;"> container_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">,</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">sum</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;font-family:Courier New;">total_pages</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">as</span><span style="font-size:x-small;font-family:Courier New;"> total_pages</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                     </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">FROM</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#008000;font-family:Courier New;">sys.allocation_units</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                     </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">GROUP</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">BY</span><span style="font-size:x-small;font-family:Courier New;"> container_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">AS</span><span style="font-size:x-small;font-family:Courier New;"> au</span></p>
<p><span style="font-size:x-small;font-family:Courier New;">                </span><span style="font-size:x-small;color:#0000ff;font-family:Courier New;">ON</span><span style="font-size:x-small;font-family:Courier New;"> au</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">container_id </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> p</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;font-family:Courier New;">partition_id</span></p>
<p>     <span style="font-size:x-small;color:#0000ff;font-family:Courier New;">WHERE</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">OBJECT_NAME</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">(</span><span style="font-size:x-small;font-family:Courier New;">i</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">.</span><span style="font-size:x-small;color:#ff00ff;font-family:Courier New;">object_id</span><span style="font-size:x-small;color:#808080;font-family:Courier New;">)</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#808080;font-family:Courier New;">=</span><span style="font-size:x-small;font-family:Courier New;"> </span><span style="font-size:x-small;color:#ff0000;font-family:Courier New;">&#8216;FactTable&#8217;</span> </p>
<p><span style="font-size:x-small;font-family:Verdana;">Some useful Tips : </span></p>
<ul type="DISC">
<li><span style="font-size:x-small;font-family:Verdana;">Always use a rule on DataFiles/FileGroup nomenclature, to make it easier to understand the dependencies.</span></li>
<li><span style="font-size:x-small;font-family:Verdana;">When partitioning tables, don’t randomize the creation of the DataFiles, for example put the DF1 on StorageA, DF2 on StorageB, DF3 on StorageC, DF4 on StorageA,DF4 on StorageB&#8230;</span></li>
<li><span style="font-size:x-small;font-family:Verdana;">For best performance align your non-clustered indexes with the partition.</span></li>
<li><span style="font-size:x-small;font-family:Verdana;">After the end of the previous month, rebuild the respective previous partition number.</span></li>
<li><span style="font-size:x-small;font-family:Verdana;">Be creative ! </span></li>
</ul>
<p><span style="font-size:x-small;font-family:Verdana;">Paulo Condeça. paulo at citen dot net</span></div>
</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/netic.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/netic.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/netic.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/netic.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/netic.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/netic.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/netic.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/netic.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/netic.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/netic.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/netic.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/netic.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=8&subd=netic&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://netic.wordpress.com/2008/08/11/microsoft-sql-server-2005-partitioning-english-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a02d019603fa7ac617f49043696f2fce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Netic</media:title>
		</media:content>
	</item>
		<item>
		<title>MICROSOFT SQL SERVER 2005 Partitioning (Versão Portuguesa)</title>
		<link>http://netic.wordpress.com/2008/05/05/microsoft-sql-server-2005-partitioning/</link>
		<comments>http://netic.wordpress.com/2008/05/05/microsoft-sql-server-2005-partitioning/#comments</comments>
		<pubDate>Mon, 05 May 2008 17:08:34 +0000</pubDate>
		<dc:creator>Paulo Condeça</dc:creator>
				<category><![CDATA[SQLSERVER]]></category>
		<category><![CDATA[DATAWAREHOUSE]]></category>
		<category><![CDATA[PARTITIONING]]></category>
		<category><![CDATA[PERFORMANCE]]></category>
		<category><![CDATA[SCALABILITY]]></category>
		<category><![CDATA[TUNING]]></category>

		<guid isPermaLink="false">http://netic.wordpress.com/?p=3</guid>
		<description><![CDATA[Objectivo
I. Benefícios e Limitações de Partitioned Clustered INDEX em SQL SERVER 2005.
II. Metodologia de Implementação.
III. Gestão de Particionamento.
Descrição
I. Benefícios e Limitações de Partitioned Clustered INDEX em SQL SERVER 2005:
+
Dados podem ser acedidos através de múltiplas partições em paralelo.
Diferentes partições podem ser geridas em separado.
Gestão de Histórico mais eficiente, sem ter que sair da tabela.
-
Limite de [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=3&subd=netic&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Objectivo</p>
<p>I. Benefícios e Limitações de Partitioned Clustered INDEX em SQL SERVER 2005.</p>
<p>II. Metodologia de Implementação.</p>
<p>III. Gestão de Particionamento.</p>
<p>Descrição</p>
<p>I. Benefícios e Limitações de Partitioned Clustered INDEX em SQL SERVER 2005:</p>
<p>+</p>
<p>Dados podem ser acedidos através de múltiplas partições em paralelo.</p>
<p>Diferentes partições podem ser geridas em separado.</p>
<p>Gestão de Histórico mais eficiente, sem ter que sair da tabela.</p>
<p>-</p>
<p>Limite de 1000 Partições por Tabela.<br />
Impossibilidade de utilização de Indexed Views.</p>
<p>II. Metodologia de Particionamento TabelaXPTO:</p>
<p>Esta abordagem vai ter como base de trabalho um particionamento trimestral.</p>
<p>1. Criar a função de particionamento com DataType SMALLDATETIME como parâmetro.</p>
<p>CREATE PARTITION FUNCTION PFTabelaXPTOQuarterly (SMALLDATETIME)<br />
AS RANGE RIGHT<br />
FOR VALUES (<br />
&#8216;2006-07-01&#8242;,&#8217;2006-10-01&#8242;,<br />
&#8216;2007-01-01&#8242;,&#8217;2007-04-01&#8242;,&#8217;2007-07-01&#8242;,<br />
&#8216;2007-10-01&#8242;,&#8217;2008-01-01&#8242;,&#8217;2008-04-01&#8242;<br />
)</p>
<p>2. Adicionar 10 FILEGROUPS À BD.</p>
<p>ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_QBASE<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q1<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q2<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q3<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q4<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q5<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q6<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q7<br />
ALTER DATABASE DBA ADD FILEGROUP FG_TABELAXPTO_Q8</p>
<p>3. Implementar a Partition Scheme PSTabelaXPTOQuarterly, com a Partition Function PFTabelaXPTOQuarterly como parametro.</p>
<p>CREATE PARTITION SCHEME PSTabelaXPTOQuarterly<br />
AS PARTITION PFTabelaXPTOQuarterly<br />
TO<br />
(<br />
FG_TABELAXPTO_QBASE,<br />
FG_TABELAXPTO_Q1,<br />
FG_TABELAXPTO_Q2,<br />
FG_TABELAXPTO_Q3,<br />
FG_TABELAXPTO_Q4,<br />
FG_TABELAXPTO_Q5,<br />
FG_TABELAXPTO_Q6,<br />
FG_TABELAXPTO_Q7,<br />
FG_TABELAXPTO_Q8</p>
<p>)</p>
<p>• Nesta situação, o primeiro FG tem todos os dados desde Abril 2006 até Julho 2006.<br />
• Os seguintes FG’s tem a data que correspondente ao valor de cada partition.<br />
• O último FG tem todos os dados com data superior a Abril 2008.</p>
<p>4. Implementar o Partitioned Clustered Index na TabelaXPTO na Partition Scheme PSTabelaXPTOQuarterly .</p>
<p>CREATE CLUSTERED INDEX PCIX on dbo.posicao_contrato (data_contrato)<br />
WITH (PAD_INDEX = ON, FILLFACTOR = 90)<br />
ON PSTabelaXPTOQuarterly (data_contrato)</p>
<p>III. Gestão do Particionamento :</p>
<p>Com o exemplo de particionamento actual, surge a questão do que fazer quando se</p>
<p>começar a inserir registos com data &gt;=Julho (2008Q3)?.</p>
<p>• Antes de se chegar ao final do Trimestre, cria-se um novo DataFile e Filegroup ( exemplo: FG_TABELAXPTO_2008Q3 ).</p>
<p>• Altera-se a PartitionScheme, adicionando-lhe um Filegroup.<br />
ALTER PARTITION SCHEME PSTabelaXPTOQuarterly<br />
NEXT USED [FG_TABELAXPTO_2008Q3] .</p>
<p>• Altera-se a PartitionFunction, adicionando-lhe uma nova Boundary(fronteira).<br />
ALTER PARTITION FUNCTION PFTabelaXPTOQuarterly ()<br />
SPLIT RANGE (&#8216;20080701&#8242;);</p>
<p>Como saber quantas partições estão associadas ao Clustered Index da TabelaXPTO:</p>
<p>SELECT * FROM sys.partitions<br />
WHERE object_id=object_id(&#8216;posicao_contrato&#8217;)</p>
<p>Informação relativa à partition function utilizada.</p>
<p>SELECT * FROM sys.partition_functions<br />
WHERE name=&#8217;PFTabelaXPTOQuarterly&#8217;</p>
<p>Mostra as boundaries da Partition Function .</p>
<p>SELECT a.name,b.* FROM sys.partition_functions a, sys.partition_range_values b<br />
WHERE a.function_id=b.function_id<br />
and a.name=&#8217;PFTabelaXPTOQuarterly&#8217;</p>
<p>Informação básica de segmentação de registos por partição</p>
<p>SELECT *<br />
FROM sys.partitions<br />
WHERE object_id=object_id(&#8216;posicao_contrato&#8217;)<br />
Query que retorna um registo por partition_number, contem informação de<br />
que Filegroups estão associados ás Partitions, quantos registos, quantas pages e as</p>
<p>respectivas Boundary.</p>
<p>SELECT OBJECT_NAME(i.object_id) AS Object_Name,<br />
i.index_id AS Index_ID,<br />
p.partition_number, fg.name AS Filegroup_Name, rows, au.total_pages,<br />
CASE boundary_value_on_right<br />
WHEN 1 THEN &#8216;less than&#8217;<br />
ELSE &#8216;less than or equal to&#8217; END as &#8216;comparison&#8217;, value<br />
FROM sys.partitions p JOIN sys.indexes i<br />
ON p.object_id = i.object_id and p.index_id = i.index_id<br />
JOIN sys.partition_schemes ps<br />
ON ps.data_space_id = i.data_space_id<br />
JOIN sys.partition_functions f<br />
ON f.function_id = ps.function_id<br />
LEFT JOIN sys.partition_range_values rv<br />
ON f.function_id = rv.function_id<br />
AND p.partition_number = rv.boundary_id<br />
JOIN sys.destination_data_spaces dds<br />
ON dds.partition_scheme_id = ps.data_space_id<br />
AND dds.destination_id = p.partition_number<br />
JOIN sys.filegroups fg<br />
ON dds.data_space_id = fg.data_space_id<br />
JOIN (SELECT container_id, sum(total_pages) as total_pages<br />
FROM sys.allocation_units<br />
GROUP BY container_id) AS au<br />
ON au.container_id = p.partition_id<br />
&#8211;WHERE i.index_id &lt;2;<br />
WHERE OBJECT_NAME(i.object_id) = &#8216;tabelaXPTO&#8217;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/netic.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/netic.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/netic.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/netic.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/netic.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/netic.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/netic.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/netic.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/netic.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/netic.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/netic.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/netic.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=netic.wordpress.com&blog=1762839&post=3&subd=netic&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://netic.wordpress.com/2008/05/05/microsoft-sql-server-2005-partitioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a02d019603fa7ac617f49043696f2fce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Netic</media:title>
		</media:content>
	</item>
	</channel>
</rss>