<?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>table partitioning &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/table-partitioning/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, 20 Nov 2017 11:01:38 +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>PostgreSQL 10: Introduced Native Table Partitioning</title>
		<link>https://www.dbrnd.com/2017/12/postgresql-10-introduced-native-table-partitioning/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 12 Dec 2017 16:16:22 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Native Table Partitioning]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 10]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[range partition]]></category>
		<category><![CDATA[table partitioning]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6793</guid>

					<description><![CDATA[PostgreSQL 10 introduced the native table partitioning which is better than old/manual table partitioning. Before, we had to manage table partitioning by specifying Trigger and Check constraint. Now, in the new version, it handles automatically and reduces the work of DBA. Check the below example of Native Table Partitioning: Create a table and define the [&#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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&amp;linkname=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" 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%2F12%2Fpostgresql-10-introduced-native-table-partitioning%2F&#038;title=PostgreSQL%2010%3A%20Introduced%20Native%20Table%20Partitioning" data-a2a-url="https://www.dbrnd.com/2017/12/postgresql-10-introduced-native-table-partitioning/" data-a2a-title="PostgreSQL 10: Introduced Native Table Partitioning"></a></p><p>PostgreSQL 10 introduced the native table partitioning which is better than old/manual table partitioning. </p>
<p>Before, we had to manage table partitioning by specifying Trigger and Check constraint.<br />
Now, in the new version, it handles automatically and reduces the work of DBA. </p>
<p>Check the below example of Native Table Partitioning:</p>
<p><strong>Create a table and define the Partition column:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_employee 
(
     empid int GENERATED BY DEFAULT AS IDENTITY,
     empname character varying,
     joiningdate timestamp without time zone
) PARTITION BY RANGE (joiningdate);</pre> </p>
<p><strong>Create three sample partitions on joiningdate:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_employee_history_201701
PARTITION OF tbl_employee
FOR VALUES FROM ('2017-01-01 00:00:00') TO ('2017-01-31 23:59:59');

CREATE TABLE tbl_employee_history_201702
PARTITION OF tbl_employee
FOR VALUES FROM ('2017-02-01 00:00:00') TO ('2017-02-28 23:59:59');

CREATE TABLE tbl_employee_history_201703
PARTITION OF tbl_employee
FOR VALUES FROM ('2017-03-01 00:00:00') TO ('2017-03-31 23:59:59');</pre> </p>
<p><strong>Insert few sample records:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_employee
VALUES (1,'Anvesh','2017-01-08'),
(2,'Roy','2017-02-10'),(3,'Jenny','2017-03-12');</pre> </p>
<p><strong>Check the main table, you can get all records:</strong></p>
<pre class="crayon-plain-tag">select *From tbl_employee;</pre> </p>
<p><strong>Check individual table partition for specific range data:</strong></p>
<pre class="crayon-plain-tag">select *From tbl_employee_history_201701;
select *From tbl_employee_history_201702;
select *From tbl_employee_history_201703;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Implement Table Partition in Non Enterprise Edition (Use Partitioned View)</title>
		<link>https://www.dbrnd.com/2017/09/sql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view/</link>
					<comments>https://www.dbrnd.com/2017/09/sql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 03 Sep 2017 16:16:45 +0000</pubDate>
				<category><![CDATA[Database Designing]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Partitioned View]]></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[table partitioning]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6022</guid>

					<description><![CDATA[In this post, I am sharing a full demonstration of the concept of Partitioned view in SQL Server. Using Partitioned view, you can implement Table Partitioning in the Non-Enterprise Edition of SQL Server because Table Partition is the feature of SQL Server Enterprise Edition. Many small level companies are searching for this kind of solution, [&#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%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&amp;linkname=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%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%2F2017%2F09%2Fsql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view%2F&#038;title=SQL%20Server%3A%20Implement%20Table%20Partition%20in%20Non%20Enterprise%20Edition%20%28Use%20Partitioned%20View%29" data-a2a-url="https://www.dbrnd.com/2017/09/sql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view/" data-a2a-title="SQL Server: Implement Table Partition in Non Enterprise Edition (Use Partitioned View)"></a></p><p>In this post, I am sharing a full demonstration of the concept of Partitioned view in SQL Server.</p>
<p>Using Partitioned view, you can implement Table Partitioning in the Non-Enterprise Edition of SQL Server because Table Partition is the feature of SQL Server Enterprise Edition.</p>
<p>Many small level companies are searching for this kind of solution, and the concept of Partitioned view is also giving a good performance. </p>
<blockquote><p>We can also say that this is a manual table partitioning where you must create separate physical tables basis on your require partition ranges and require to apply proper CHECK constraint for validating data ranges. </p>
<p>After this, using one view, you can access all table and accordingly query execution plan also access only require table which reduces the unnecessary load on all or whole table. </p></blockquote>
<p>Please check the below demonstration and try it your self.</p>
<p><strong>Create a SEQUENCE object:</strong></p><pre class="crayon-plain-tag">CREATE SEQUENCE dbo.seq_ProductHistory
    START WITH 1  
    INCREMENT BY 1 ;  
GO</pre><p>
<strong>Create four physical tables:</strong></p><pre class="crayon-plain-tag">CREATE TABLE dbo.tbl_ProductHistory_Q1
(
	ProductID INT
	,ProductName VARCHAR(20)
	,SoldDate DATE
	,ProductSoldQuarter TINYINT CHECK (ProductSoldQuarter = 1)
	,CONSTRAINT pk_tbl_ProductHistory_Q1_ProductID_ProductSoldQuarter PRIMARY KEY(ProductID, ProductSoldQuarter)
)
GO

CREATE TABLE dbo.tbl_ProductHistory_Q2
(
	ProductID INT 
	,ProductName VARCHAR(20)
	,SoldDate DATE
	,ProductSoldQuarter TINYINT CHECK (ProductSoldQuarter = 2)
	,CONSTRAINT pk_tbl_ProductHistory_Q2_ProductID_ProductSoldQuarter PRIMARY KEY(ProductID, ProductSoldQuarter)
)
GO

CREATE TABLE dbo.tbl_ProductHistory_Q3
(
	ProductID INT 
	,ProductName VARCHAR(20)
	,SoldDate DATE
	,ProductSoldQuarter TINYINT CHECK (ProductSoldQuarter = 3)
	,CONSTRAINT pk_tbl_ProductHistory_Q3_ProductID_ProductSoldQuarter PRIMARY KEY(ProductID, ProductSoldQuarter)
)
GO

CREATE TABLE dbo.tbl_ProductHistory_Q4
(
	ProductID INT 
	,ProductName VARCHAR(20)
	,SoldDate DATE
	,ProductSoldQuarter TINYINT CHECK (ProductSoldQuarter = 4)
	,CONSTRAINT pk_tbl_ProductHistory_Q4_ProductID_ProductSoldQuarter PRIMARY KEY(ProductID, ProductSoldQuarter)
)
GO</pre><p>
<strong>Create a Partitioned View:</strong></p><pre class="crayon-plain-tag">CREATE VIEW dbo.vw_ProductHistory
WITH SCHEMABINDING
AS
SELECT ProductID, ProductName, SoldDate, ProductSoldQuarter FROM dbo.tbl_ProductHistory_Q1
UNION ALL
SELECT ProductID, ProductName, SoldDate, ProductSoldQuarter FROM dbo.tbl_ProductHistory_Q2
UNION ALL
SELECT ProductID, ProductName, SoldDate, ProductSoldQuarter FROM dbo.tbl_ProductHistory_Q3
UNION ALL
SELECT ProductID, ProductName, SoldDate, ProductSoldQuarter FROM dbo.tbl_ProductHistory_Q4
GO</pre><p>
<strong>Use view and Insert data into four tables:</strong></p><pre class="crayon-plain-tag">INSERT INTO dbo.vw_ProductHistory 
VALUES (NEXT VALUE FOR dbo.seq_ProductHistory, 'Computer', '2017-01-08', 1)
GO

INSERT INTO dbo.vw_ProductHistory 
VALUES (NEXT VALUE FOR dbo.seq_ProductHistory, 'Laptop', '2017-04-14', 2)
GO

INSERT INTO dbo.vw_ProductHistory 
VALUES (NEXT VALUE FOR dbo.seq_ProductHistory, 'Pendrive', '2017-08-16', 3)
GO

INSERT INTO dbo.vw_ProductHistory 
VALUES (NEXT VALUE FOR dbo.seq_ProductHistory, 'Mobile', '2017-12-26', 4)
GO</pre><p>
<strong>SELECT all records from all four tables via view:</strong><br />
Check the execution plan, where you can see four different access on physical tables.</p><pre class="crayon-plain-tag">SELECT *FROM dbo.vw_ProductHistory</pre><p>
<strong>Result:</strong></p><pre class="crayon-plain-tag">ProductID   ProductName          SoldDate   ProductSoldQuarter
----------- -------------------- ---------- ------------------
1           Computer             2017-01-08 1
2           Laptop               2017-04-14 2
3           Pendrive             2017-08-16 3
4           Mobile               2017-12-26 4</pre><p>
<strong>Check the execution plan: It is accessing all four physical tables</strong></p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-6027" src="https://www.dbrnd.com/wp-content/uploads/2017/08/PartitionedViewAllScan.png" alt="" width="539" height="391" /></p>
<p><strong>SELECT few records:</strong><br />
Check the execution plan, where you can find only access of Quarter-4 table because we are selecting data only for it.</p><pre class="crayon-plain-tag">SELECT *FROM dbo.vw_ProductHistory 
WHERE ProductSoldQuarter = 4</pre><p>
<strong>Result:</strong></p><pre class="crayon-plain-tag">ProductID   ProductName          SoldDate   ProductSoldQuarter
----------- -------------------- ---------- ------------------
4           Mobile               2017-12-26 4</pre><p>
<strong>Check the execution plan: It is accessing only Quarter-4 table.</strong></p>
<p><img decoding="async" class="alignnone size-full wp-image-6026" src="https://www.dbrnd.com/wp-content/uploads/2017/08/PartitionedViewSingalScan.png" alt="" width="582" height="131" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/09/sql-server-implement-table-partition-in-non-enterprise-edition-use-partitioned-view/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</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>
