<?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/"
	>

<channel>
	<title>partition function &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/partition-function/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 18 Sep 2017 11:01:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server Interview: Difference between Filtered Index and Table Partition</title>
		<link>https://www.dbrnd.com/2017/03/sql-server-interview-difference-between-filtered-index-and-table-partition/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 18 Mar 2017 16:16:40 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Filtered Index]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[partition function]]></category>
		<category><![CDATA[Partition scheme]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[Table Partition]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4773</guid>

					<description><![CDATA[If you are SQL DBA and if I am taking your interview, definitely I will ask this question to you. If you don&#8217;t know about Filtered Index and how to create a Table Partition in SQL Server, please visit below articles: SQL Server: Filtered Indexes &#8211; Improved the query performance SQL Server 2016: Introduce New [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&amp;linkname=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-interview-difference-between-filtered-index-and-table-partition%2F&#038;title=SQL%20Server%20Interview%3A%20Difference%20between%20Filtered%20Index%20and%20Table%20Partition" data-a2a-url="https://www.dbrnd.com/2017/03/sql-server-interview-difference-between-filtered-index-and-table-partition/" data-a2a-title="SQL Server Interview: Difference between Filtered Index and Table Partition"></a></p><p>If you are SQL DBA and if I am taking your interview, definitely I will ask this question to you.<br />
If you don&#8217;t know about Filtered Index and how to create a Table Partition in SQL Server, please visit below articles:</p>
<blockquote class="wp-embedded-content" data-secret="JVP5sA9RpP"><p><a href="https://www.dbrnd.com/2017/01/sql-server-filtered-indexes-improved-the-query-performance/">SQL Server: Filtered Indexes &#8211; Improved the query performance</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/sql-server-filtered-indexes-improved-the-query-performance/embed/#?secret=JVP5sA9RpP" data-secret="JVP5sA9RpP" width="600" height="338" title="&#8220;SQL Server: Filtered Indexes &#8211; Improved the query performance&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="n6fhw7WVTT"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2016-introduce-new-truncate-by-partitions-number/">SQL Server 2016: Introduce New TRUNCATE  by Partitions Number</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2016-introduce-new-truncate-by-partitions-number/embed/#?secret=n6fhw7WVTT" data-secret="n6fhw7WVTT" width="600" height="338" title="&#8220;SQL Server 2016: Introduce New TRUNCATE  by Partitions Number&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Filtered Index:</strong></p>
<ul>
<li>You can store a portion of your dataset in Filtered Index. For example, Created a filtered index on Gender column for only &#8216;Male&#8217;, then it stores only &#8216;Male&#8217; detailed index data.</li>
<li>Filtered index only applies to a subset of the base table which is not allowing a fast switching.</li>
<li>You can reduce the CPU I/O by reading a particular value of a Filtered Index.</li>
<li>The Filtered index stores only keys and reference of data.</li>
<li>Once you create a Filtered Index on the PartitionScheme, you have to create same Filtered Index for every new table partitions which create a problem because a combination of Filtered indexes may contain the different value.</li>
<li>If you already apply table partition, you should not apply filtered indexes on those partitions.</li>
</ul>
<p><strong>Table Partition:</strong></p>
<ul>
<li>The Table Partitioning breaks your main table into small groups of tables based on defined partitioning key.<br />
The data physically divided for better management and fast retrieval.</li>
<li>For example, you have a 20GB of a table, and it contains total 5 years of data so you can partition your table base on years which will create five table partitions with each size of 4GB.</li>
<li>To implement Table partitioning, you need to create .ndf files for each partition, partition function, partition scheme.</li>
<li>It stores all columns of your table in partitions; it is not just storing the key of data like Filtered Index.<br />
You can define indexes on each table partitions.</li>
<li>The maintenance of Table Partitions is costly and time taking.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-13)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 24 Jun 2016 07:06:36 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database Developer]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[index partitioning]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[LAG]]></category>
		<category><![CDATA[LEAD]]></category>
		<category><![CDATA[partition function]]></category>
		<category><![CDATA[partition schema]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[table partitioning]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3075</guid>

					<description><![CDATA[What is a Table and Index Partitioning in SQL Server? Partitioning makes large tables or indexes more manageable, because partitioning enables you to manage and access subsets of data quickly and efficiently, while maintaining the integrity of a data collection. By using partitioning, an operation such as loading data from an OLTP to an OLAP [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13%2F&#038;title=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-13%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-table-index-partitioning-partition-function-schema-day-13/" data-a2a-title="SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-13)"></a></p><p><strong>What is a Table and Index Partitioning in SQL Server?</strong></p>
<blockquote><p>Partitioning makes large tables or indexes more manageable, because partitioning enables you to manage and access subsets of data quickly and efficiently, while maintaining the integrity of a data collection. By using partitioning, an operation such as loading data from an OLTP to an OLAP system takes only seconds, instead of the minutes and hours.</p>
<p>Maintenance operations that are performed on subsets of data are also performed more efficiently because these operations target only the data that is required, instead of the whole table.</p>
<p>The data of partitioned tables and indexes is divided into units that can be spread across more than one filegroup in a database. The data is partitioned horizontally, so that groups of rows are mapped into individual partitions. The table or index is treated as a single logical entity when queries or updates are performed on the data. All partitions of a single index or table must reside in the same database.</p>
<p>Partitioned tables and indexes support all the properties and features associated with designing and querying standard tables and indexes, including constraints, defaults, identity and timestamp values, and triggers. Therefore, if you want to implement a partitioned view that is local to one server, you might want to implement a partitioned table instead.</p></blockquote>
<p><strong>Can you perform a table or index partitioning in SQL Server standard or web edition?</strong></p>
<blockquote><p>No: Partitioned tables and indexes are available only on the Enterprise, Developer, and Evaluation editions of SQL Server.</p></blockquote>
<p><strong>In which situation, we require to implement table or index partitioning?</strong></p>
<blockquote><p>Deciding whether to implement partitioning depends primarily on how large your table is or how large it will become, how it is being used, and how well it is performing against user queries and maintenance operations.</p>
<p>Generally, a large table might be appropriate for partitioning if both of the following are true:</p>
<p>The table contains, or is expected to contain, lots of data that are used in different ways.</p>
<p>Queries or updates against the table are not performing as intended, or maintenance costs exceed predefined maintenance periods.</p>
<p>For example, if a current month of data is primarily used for INSERT, UPDATE, DELETE, and MERGE operations while previous months are used primarily for SELECT queries, managing this table may be easier if it is partitioned by month.</p></blockquote>
<p><strong>Would you please describe the basic steps to implement partitioning on Table or Index?</strong></p>
<p>Creating a partitioned table or index typically happens in four parts:</p>
<ul>
<li>Create a filegroup or filegroups and corresponding files that will hold the partitions specified by the partition scheme.</li>
<li>Create a partition function that maps the rows of a table or index into partitions based on the values of a specified column.</li>
<li>Create a partition scheme that maps the partitions of a partitioned table or index to the new filegroups.</li>
<li>Create or modify a table or index and specify the partition scheme as the storage location.</li>
</ul>
<p><strong>What is a Partition Function?</strong></p>
<blockquote><p>A partition function defines how the rows of a table or index are mapped to a set of partitions based on the values of certain columns, called partitioning columns.</p></blockquote>
<p><strong>Do you know the syntax of PARTITION FUNCTION?</strong></p><pre class="crayon-plain-tag">CREATE PARTITION FUNCTION partition_function_name ( input_parameter_type )  
AS RANGE [ LEFT | RIGHT ]   
FOR VALUES ( [ boundary_value [ ,...n ] ] )   
[ ; ]</pre><p>
<strong>What is a Partition Scheme?</strong></p>
<blockquote><p>A partition scheme maps each partition specified by the partition function to a filegroup.</p></blockquote>
<p><strong>Do you know the syntax of PARTITION SCHEME?</strong></p><pre class="crayon-plain-tag">CREATE PARTITION SCHEME partition_scheme_name  
AS PARTITION partition_function_name  
[ ALL ] TO ( { file_group_name | [ PRIMARY ] } [ ,...n ] )  
[ ; ]</pre><p>
<strong>What are the limitations of Partitioning?</strong></p>
<blockquote><p>The scope of a partition function and scheme is limited to the database in which they have been created. Within the database, partition functions reside in a separate namespace from other functions.</p>
<p>If any rows within a partition function have partitioning columns with null values, these rows are allocated to the left-most partition.</p>
<p>However, if NULL is specified as a boundary value and RIGHT is indicated, the left-most partition remains empty and NULL values are placed in the second partition.</p></blockquote>
<p><strong>Which system table is used to find the information about the database partitions?</strong></p>
<blockquote><p>Using sys.partitions, It contains a row for each partition of all the tables and most types of indexes in the database.</p></blockquote>
<p><strong>Does it make sense to design a partitioned index separately?</strong></p>
<ul>
<li>Although partitioned indexes can be implemented independently from their base tables, it generally makes sense to design a partitioned table and then create an index on the table. When you do this, SQL Server automatically partitions the index by using the same partition scheme and partitioning column as the table.</li>
<li>As a result, the index is partitioned in essentially the same manner as the table. This makes the index aligned with the table.</li>
<li>SQL Server does not align the index with the table if you specify a different partition scheme or a separate filegroup on which to put the index at creation time.</li>
</ul>
<p><strong>When you should implement Index partitioning?</strong></p>
<p>Designing a partitioned index independently (unaligned) of the base table can be useful in the following cases:</p>
<ul>
<li>The base table has not been partitioned.</li>
<li>The index key is unique and it does not contain the partitioning column of the table.</li>
<li>You want the base table to participate in collocated joins with more tables using different join columns.</li>
</ul>
<p><strong>What do you know about the Functional Dependency?</strong></p>
<blockquote><p>Functional dependency (FD) is a set of constraints between two attributes in a relation. Functional dependency says that if two tuples have same values for attributes A1, A2,&#8230;, An, then those two tuples must have to have same values for attributes B1, B2, &#8230;, Bn.</p>
<p>Functional dependency is represented by an arrow sign (→) that is, X→Y, where X functionally determines Y. The left-hand side attributes determine the values of attributes on the right-hand side.</p></blockquote>
<p><strong>What is the difference between =,== and ===?</strong></p>
<ul>
<li>&#8216;=&#8217;: is for assigning one value to the other variable.</li>
<li>&#8216;==&#8217;: is for the comparison between string with number, number with number etc.</li>
<li>&#8216;===&#8217;: is for the comparison between only number with number and string with string.</li>
</ul>
<p><strong>What do you mean by the derived tables?</strong></p>
<blockquote><p>They are basically select statements in the from clause referred to by an alias name. The alias name creates a table in the result set that can then be referred to by some other Select statement.</p>
<p>It also called as Inline views.</p></blockquote>
<p><strong>What is a deterministic and nondeterministic function in SQL Server?</strong></p>
<ul>
<li>A deterministic function will return the same result when it is called with the same set of input parameters. Adding two numbers together is an example of a deterministic function.</li>
<li>A nondeterministic function, on the other hand, may return different results every time they are called with the same set of input values.</li>
</ul>
<p><strong>What do you know about LEAD() of SQL Server 2012?</strong></p>
<blockquote class="wp-embedded-content" data-secret="LMpySq95k2"><p><a href="https://www.dbrnd.com/2016/02/sql-server-2012-introduced-lead-function-the-best-alternative-of-self-join-to-compare-next-row/">SQL Server 2012: Introduced LEAD function, the best alternative of Self Join to compare Next Row</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/02/sql-server-2012-introduced-lead-function-the-best-alternative-of-self-join-to-compare-next-row/embed/#?secret=LMpySq95k2" data-secret="LMpySq95k2" width="600" height="338" title="&#8220;SQL Server 2012: Introduced LEAD function, the best alternative of Self Join to compare Next Row&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What do you know about LAG() of SQL Server 2012?</strong></p>
<blockquote class="wp-embedded-content" data-secret="hj18uS7T7x"><p><a href="https://www.dbrnd.com/2016/02/sql-server-2012-introduced-lag-function-the-best-alternative-of-self-join-to-compare-previous-row/">SQL Server 2012: Introduced LAG function, the best alternative of Self Join to compare Previous Row</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/02/sql-server-2012-introduced-lag-function-the-best-alternative-of-self-join-to-compare-previous-row/embed/#?secret=hj18uS7T7x" data-secret="hj18uS7T7x" width="600" height="338" title="&#8220;SQL Server 2012: Introduced LAG function, the best alternative of Self Join to compare Previous Row&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
