<?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>Architecture &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/architecture/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>Tue, 21 Nov 2017 13:18:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>PostgreSQL: What is Visibility Map (VM)?</title>
		<link>https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/</link>
					<comments>https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 09 Oct 2016 16:16:13 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[_vm]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Multiversion Concurrency Control]]></category>
		<category><![CDATA[MVCC]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[visibility map]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3657</guid>

					<description><![CDATA[The Visibility Map is one of the important architectural notes of PostgreSQL. The Visibility Map associates with each Table and Index. It stores in separate relation alongside with main relation and It starts with the file node number plus a suffix _vm. The Visibility Map uses to keep track of which pages contain only tuples [&#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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&amp;linkname=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" 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%2F10%2Fpostgresql-what-is-visibility-map-vm-table-mvcc-architecture%2F&#038;title=PostgreSQL%3A%20What%20is%20Visibility%20Map%20%28VM%29%3F" data-a2a-url="https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/" data-a2a-title="PostgreSQL: What is Visibility Map (VM)?"></a></p><p>The Visibility Map is one of the important architectural notes of PostgreSQL. </p>
<blockquote><p>The Visibility Map associates with each Table and Index. </p></blockquote>
<blockquote><p>It stores in separate relation alongside with main relation and It starts with the file node number plus a suffix _vm.</p></blockquote>
<blockquote><p>The Visibility Map uses to keep track of which pages contain only tuples that are known to be visible to all active transactions.</p></blockquote>
<blockquote><p>It stores one bit per page. If it set bit, that means no free space on the page and all tuples can be visible to running transaction.</p></blockquote>
<p>If you do not know about the MVCC (Multiversion Concurrency Control), please visit below an article. </p>
<blockquote data-secret="9d2lV94Iju" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/">What is Multi Version Concurrency Control (MVCC)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/embed/#?secret=9d2lV94Iju" data-secret="9d2lV94Iju" width="600" height="338" title="&#8220;What is Multi Version Concurrency Control (MVCC)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Why VACUUM requires in MVCC because VACUUM removes dead row versions in tables and marks the space available for future reuse.</p>
<p>With the Visibility Map, VACUUM will be now able to perform partial scans of the table data, skipping pages which marks as fully visible. </p></blockquote>
<blockquote><p>Now Database Administrator happy because partial scans require fewer I/O operations for VACUUM. </p></blockquote>
<blockquote><p>The Visibility map bits are only set by vacuum but are cleared by any data-modifying operations on a page.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-5)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 29 May 2016 17:23:37 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[pages]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2910</guid>

					<description><![CDATA[What is the max degree of parallelism option? When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-5%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-5/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-5)"></a></p><p><strong>What is the max degree of parallelism option?</strong></p>
<blockquote><p>When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution.</p></blockquote>
<p><strong>What is MAXDOP in SQL Server?</strong></p>
<blockquote><p>Maximum Degree of Parallelism (MAXDOP) is an option in SQL server which enables you to configure SQL Server to use available CPU/CPUs to run a single statement in parallel execution plan. MAXDOP configuration highly depends on SQL Server edition, CPU type and operating system.</p>
<p>In my experience, I had to play with MAXDOP for certain statements coming from different servers in order to find best option of MAXDOP.</p></blockquote>
<p><strong>What is the MAXDOP query hint option?</strong></p>
<blockquote><p>You can override the max degree of parallelism value in queries by specifying the MAXDOP query hint in the query statement.</p></blockquote>
<p><strong>T-SQL script to change max degree of parallelism Option.</strong></p>
<blockquote><p>Setting maximum degree of parallelism to 0 allows SQL Server to use all the available processors up to 64 processors.<br />
To suppress parallel plan generation, set max degree of parallelism to 1. Set the value to a number greater than 1 to restrict the maximum number of processors used by a single query execution.</p><pre class="crayon-plain-tag">sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'max degree of parallelism', 8;
GO
RECONFIGURE WITH OVERRIDE;
GO</pre><p>
</p></blockquote>
<p><strong>SQL Server 2014: What is Hekaton?</strong></p>
<blockquote class="wp-embedded-content" data-secret="LR1MqWpsGO"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2014-what-is-hekaton/">SQL Server 2014: What is Hekaton?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2014-what-is-hekaton/embed/#?secret=LR1MqWpsGO" data-secret="LR1MqWpsGO" width="600" height="338" title="&#8220;SQL Server 2014: What is Hekaton?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>SQL Server 2014: Create Memory Optimized File Group and Table.</strong></p>
<blockquote class="wp-embedded-content" data-secret="QSkDTl0ZZN"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2014-create-memory-optimized-file-group-and-table/">SQL Server 2014: Create Memory Optimized File Group and Table</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2014-create-memory-optimized-file-group-and-table/embed/#?secret=QSkDTl0ZZN" data-secret="QSkDTl0ZZN" width="600" height="338" title="&#8220;SQL Server 2014: Create Memory Optimized File Group and Table&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is a Read-Ahead mechanism?</strong></p>
<blockquote><p>The Database Engine supports a performance optimization mechanism called read-ahead. Read-ahead anticipates the data and index pages needed to fulfill a query execution plan and brings the pages into the buffer cache before they are actually used by the query.</p></blockquote>
<p><strong>What are the types of Read-Ahead?</strong></p>
<blockquote><p>There are two types of Read-Ahead, one is Reading Data Pages and second is Reading Index Pages.</p></blockquote>
<p><strong>How internally pages are modified and written to the disk?</strong></p>
<blockquote><p>First page modification happens in the buffer cache and When a page is modified in the buffer cache, it is not immediately written back to disk;instead, the page is marked as dirty.</p>
<p>This means that a page can have more than one logical write made before it is physically written to disk.</p>
<p>For each logical write, a transaction log record is inserted in the log cache that records the modification. The log records must be written to disk before the associated dirty page is removed from the buffer cache and written to disk. SQL Server uses a technique known as write-ahead logging.</p></blockquote>
<p><strong>What is Bookmark Lookup?</strong></p>
<blockquote><p>When a SQL query requests a small number of rows, the optimizer can use the nonclustered index, if available, on the column(s) in the WHERE clause to retrieve the data. If the query refers to columns that are not part of the nonclustered index used to retrieve the data, then navigation is required from the index row to the corresponding data row in the table to access these columns.This operation is called a bookmark lookup.</p></blockquote>
<p><strong>What is a COLD, DIRTY or CLEAN Buffer?</strong></p>
<blockquote><p>The cold buffer cache has a couple of variants within SQL Server.    Typically it refers to the buffer pool right after restart.   The data cache is not loaded (cold) and requires physical reads to populate the cache.</p>
<p>Modified buffers that have not been written to disk are termed DIRTY buffers and are typically written to disk by checkpoint processing.</p>
<p>A clean buffer is a data page in memory that is NOT MODIFIED.</p></blockquote>
<p><strong>What is the use of DBCC DROPCLEANBUFFERS?</strong></p>
<blockquote><p>DBCC DROPCLEANBUFFERS removes the UNMODIFIED buffers from the buffer pool (no longer hashed) and places them on the free list.</p>
<p>This is often used in basic performance testing to clear the data cache and force the data to be retrieved from disk as a physical read instead of a logic read.</p></blockquote>
<p><strong>What is affinity I/O mask option?</strong></p>
<blockquote><p>The affinity I/O mask option binds SQL Server disk I/O to a specified subset of CPUs. In high-end SQL Server online transactional processing (OLTP) environments, this extension can enhance the performance of SQL Server threads issuing I/Os.</p></blockquote>
<p><strong>What should be the different values for affinity I/O mask?</strong></p>
<ul>
<li>A 1-byte affinity I/O mask covers up to 8 CPUs in a multiprocessor computer.</li>
<li>A 2-byte affinity I/O mask covers up to 16 CPUs in a multiprocessor computer.</li>
<li>A 3-byte affinity I/O mask covers up to 24 CPUs in a multiprocessor computer.</li>
<li>A 4-byte affinity I/O mask covers up to 32 CPUs in a multiprocessor computer.</li>
<li>To cover more than 32 CPUs, configure a four-byte affinity I/O mask for the first 32 CPUs and up to a four-byte affinity64 I/O mask for the remaining CPUs.</li>
</ul>
<p><strong>What Is Eager Writing in SQL Server?</strong></p>
<blockquote><p>Eager writing is a long back implemented idea in SQL server to prevent flooding of the buffer pool with pages that are newly created from minimally logged activities, and physically written to disk.</p>
<p>In SQL Server 2014, eager write doesn’t force dirty pages physical write as quickly as previous versions.   This allows dirty pages to spend their life time in RAM, used by SQL and flush them to free list without ever a physical write to disk as long memory is available. This will significantly increase the performance up to 300% as compared to previous versions.</p></blockquote>
<p><strong>Generally, what kind of operations are recorded in the transaction log file?</strong></p>
<ul>
<li>The start and end of each transaction.</li>
<li>Every data modification (insert, update, or delete).</li>
<li>Every extent and page allocation or deallocation.</li>
<li>Creating or dropping a table or index.</li>
<li>Rollback operations are also logged.</li>
</ul>
<p><strong>What happened if FILEGROWTH is enable and disable?</strong></p>
<ul>
<li>If the FILEGROWTH setting is enabled for the log and space is available on the disk, the file is extended by the amount specified in growth_increment and the new log records are added to the extension.</li>
<li>If the FILEGROWTH setting is not enabled, or the disk that is holding the log file has less free space than the amount specified in growth_increment, an 9002 error is generated.</li>
</ul>
<p><strong>Are you suggesting to truncate an old transaction log?</strong></p>
<blockquote><p>Yes,</p>
<p>If the log records were never deleted from the transaction log, the logical log would grow until it filled all the available space on the disks holding the physical log files. At some point in time, old log records no longer necessary for recovering or restoring a database must be deleted to make way for new log records.</p></blockquote>
<p><strong>Do you think truncate log operation reduces the size of the physical log file?</strong></p>
<blockquote><p>Log truncation does not reduce the size of a physical log file, it reduces the size of the logical log and marks as inactive the virtual logs that do not hold any part of the logical log.</p>
<p>A log shrink operation removes enough inactive virtual logs to reduce the log file to the requested size.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-3)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/</link>
					<comments>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 27 May 2016 17:30:37 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2902</guid>

					<description><![CDATA[How to find data page information? Execute DBCC IND to check allocated pages of a Table. Execute DBCC PAGE to find more information about the allocated pages. What is a Global Allocation Map (GAM)? GAM has a bit for every extent and it records what extents have been allocated for any use. It stores information [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-3%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-3)"></a></p><p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-dbcc-page-and-dbcc-ind-to-find-a-data-page-information/" target="_blank">How to find data page information?</a></strong></p>
<ul>
<li>Execute DBCC IND to check allocated pages of a Table.</li>
<li>Execute DBCC PAGE to find more information about the allocated pages.</li>
</ul>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-gam-and-sgam-pages-to-find-the-extent-space-information/" target="_blank">What is a Global Allocation Map (GAM)?</a></strong></p>
<blockquote><p>GAM has a bit for every extent and it records what extents have been allocated for any use.</p>
<p>It stores information about both Uniform and Mixed extents.</p>
<p>If the bit value is 0, extent is in use and If the bit value is 1, extent is free.</p>
<p>It can hold information about the total 64000 extents and approximately size is 4000 MB.</p></blockquote>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-gam-and-sgam-pages-to-find-the-extent-space-information/" target="_blank">What is a Shared Global Allocation Map (SGAM)?</a></strong></p>
<blockquote><p>SGAM has a bit for every extent and it records what extents are currently being used as mixed extent and have at least one unused page.</p>
<p>If the bit value is 0, either extent is not a mixed extent or it is a mixed extent and all its pages being used.</p>
<p>If the bit value is 1, it is a mixed extent and having an at least one unused page.</p></blockquote>
<p><strong>What is a Differential Changed Map (DCM)?</strong></p>
<blockquote><p>This tracks the extents that have changed since the last BACKUP DATABASE statement. If the bit for an extent is 1, the extent has been modified since the last BACKUP DATABASE statement. If the bit is 0, the extent has not been modified.</p></blockquote>
<p><strong>What is a Bulk Changed Map (BCM)?</strong></p>
<blockquote><p>This tracks the extents that have been modified by bulk logged operations since the last BACKUP LOG statement. If the bit for an extent is 1, the extent has been modified by a bulk logged operation after the last BACKUP LOG statement. If the bit is 0, the extent has not been modified by bulk logged operations.</p></blockquote>
<p><strong>What is RAID and what are different types of RAID configurations?</strong></p>
<blockquote><p>RAID stands for Redundant Array of Independent Disks. RAID defines data storage schemes to divide and replicate data among various disks so that data reliability and I/O performance can be increased.</p></blockquote>
<p><strong>What is a Connection in SQL Server?</strong></p>
<blockquote><p>A connection is established when the user is successfully logged in. The user can then submit one or more Transact-SQL statements for execution. A connection is closed when the user explicitly logs out, or the connection is terminated.</p></blockquote>
<p><strong>What is a SQL Batch?</strong></p>
<blockquote><p>A SQL batch is a set of one or more Transact-SQL statements sent from a client to an instance of SQL Server for execution. It represents a unit of work submitted to the Database Engine by users.</p></blockquote>
<p><strong>What is a Fiber?</strong></p>
<blockquote><p>A fiber is a lightweight thread that requires fewer resources than a Windows thread and can switch context when in user mode. One Windows thread can be mapped to many fibers.</p></blockquote>
<p><strong>What is a Worker Thread?</strong></p>
<blockquote><p>The worker thread represents a logical thread in SQL Server that is internally mapped (1:1) to either a Windows thread or, if lightweight pooling is turned ON, to a fiber.</p></blockquote>
<p><strong>What is the use of lightweight pooling parameter?</strong></p>
<blockquote><p>The server configuration option lightweight pooling controls whether an instance of SQL Server uses Windows threads or fibers.</p>
<p>The default for this option is 0. This indicates that the instance of SQL Server schedules a Windows thread per worker thread.</p>
<p>If lightweight pooling is set to 1, SQL Server uses fibers instead of Windows threads.</p></blockquote>
<p><strong>What is the priority boost option?</strong></p>
<blockquote><p>By default, each instance of SQL Server is a priority of 7, which is referred to as the normal priority. The priority boost configuration option can be used to increase the priority of the threads from an instance of SQL Server to 13. This is referred to as high priority.</p></blockquote>
<p><strong>What is the importance of Buffer in SQL Server?</strong></p>
<blockquote><p>The primary purpose of a SQL Server database is to store and retrieve data.</p>
<p>The disk I/O operations can consume many resources and take a relatively long time to finish, SQL Server focuses on making I/O highly efficient.</p>
<p>Buffer management is a key component in achieving this efficiency.</p>
<p>It caches the repeated data and execution plan in the buffer pool to reduce the disk I/O.</p></blockquote>
<p><strong>What is the size of the buffer in a memory?</strong></p>
<blockquote><p>A buffer is an 8-KB page in memory, the same size as a data or index page.</p></blockquote>
<p><strong>How an internal buffer manager manages the buffer cache?</strong></p>
<blockquote><p>The buffer manager manages the functions for reading data or index pages from the database disk files into the buffer cache and writing modified pages back to disk.</p>
<p>A page remains in the buffer cache until it has either not been referenced for some time or the buffer manager needs the buffer area to read in more data. Data is written back to disk only if it is modified. Data in the buffer cache can be modified multiple times before being written back to disk.</p></blockquote>
<p><strong>What is a ramp-up?</strong></p>
<blockquote><p>The interval between SQL Server startup and when the buffer cache obtains its memory target is called ramp-up.</p>
<p>The ramp-up depends on the number and type of client requests and it is transforming single-page read requests into aligned eight-page requests.</p></blockquote>
<p><strong>What is ROW LOCATOR?</strong></p>
<blockquote><p>If you define a NON CLUSTERED index on a table ,then the index row of a nonclustered index contains a pointer to the corresponding data row of the table. This pointer is called a row locator.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-3/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 26 May 2016 17:34:55 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[question]]></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[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2886</guid>

					<description><![CDATA[What is an Active Log? The section of the log file from the MinLSN to the last-written log record is called the active portion of the log, or the active log. This is the section of the log required to do a full recovery of the database. No part of the active log can ever [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-2/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-2)"></a></p><p><strong>What is an Active Log?</strong></p>
<blockquote><p>The section of the log file from the MinLSN to the last-written log record is called the active portion of the log, or the active log. This is the section of the log required to do a full recovery of the database. No part of the active log can ever be truncated. All log records must be truncated from the parts of the log before the MinLSN.</p></blockquote>
<p><strong>What is “Write Ahead Transaction Log”?</strong></p>
<blockquote><p>SQL Server uses a write-ahead log (WAL), which guarantees that no data modifications are written to disk before the associated log record is written to disk.</p>
<p>Data modifications are not made directly to disk, but are made to the copy of the page in the buffer cache. The modification is not written to disk until a checkpoint occurs in the database.</p></blockquote>
<p><strong>What is a Clustered table?</strong></p>
<blockquote><p>Clustered tables are tables that have a clustered index. The data rows are stored in order based on the clustered index key.</p></blockquote>
<p><strong>What is a Heap Table?</strong></p>
<blockquote><p>Heaps are tables that have no clustered index. The data rows are not stored in any particular order, and there is no particular order to the sequence of the data pages.</p></blockquote>
<p><strong>What is a Worktables?</strong></p>
<blockquote><p>The relational engine may need to build a worktable to perform a logical operation specified in an SQL statement. Worktables are internal tables that are used to hold intermediate results. Worktables are generated for certain GROUP BY, ORDER BY, or UNION queries.</p></blockquote>
<p><strong>What is a COMPATIBILITY_LEVEL option of the Database?</strong></p>
<blockquote><p>This lets SQL Server know with which version of SQL Server to make the database compatible.</p></blockquote>
<p><strong>What is AUTO_SHRINK option of the Database?</strong></p>
<blockquote><p>This option either turns on or off the feature that will automatically shrink your database files when free space is available. In almost all cases, this should be set to OFF.</p></blockquote>
<p><strong>What is AUTO_UPDATE_STATISTICS option of the Database?</strong></p>
<blockquote><p>When turned ON, as it should be in most cases, the optimizer will automatically keep statistics updated, in response to data modications.</p></blockquote>
<p><strong>What is READ_WRITE option of the Database?</strong></p>
<blockquote><p>This is the default option and the one to use if you want users to be able to update the database. We could also set the database to READ_ONLY to prevent any users making updates to the database.</p></blockquote>
<p><strong>What is Lazy writer?</strong></p>
<blockquote><p>Lazy writer can adjust the number of buffers in the buffer pool if dynamic memory management is enabled. The lazy writer is a system process that keeps free buffers available by removing infrequently used pages from the buffer cache.</p>
<p>Ensure that a specified number of buffers are free in the Buffer Pool so they can be allocated for use by the server.</p></blockquote>
<p><strong>How you explicitly recompile your execution plan?</strong></p>
<ul>
<li>You can use sp_recompile to explicitly recompile your execution plan.</li>
<li>You can also use WITH RECOMPILE to recompile the stored procedure.</li>
</ul>
<p><strong>What is buffer pool?</strong></p>
<blockquote><p>SQL Server builds a buffer pool in memory to hold pages read from the database. You can minimize physical I/O to the database files by maximizing the size of the buffer pool.</p></blockquote>
<p><strong>What is a query wait option?</strong></p>
<blockquote><p>Use the query wait option to specify the time in seconds (from 0 through 2147483647) that a query waits for resources before timing out. If the default value of -1 is used, or if –1 is specified, then the time-out is calculated as 25 times of the estimated query cost.</p>
<p>You can change query wait value using sp_configure.</p></blockquote>
<p><strong>How SQL Server executes a single SELECT statement?</strong></p>
<ul>
<li>The parser scans the SELECT statement and breaks it into logical units such as keywords, expressions, operators, and identifiers.</li>
<li>A query tree, sometimes referred to as a sequence tree, is built describing the logical steps needed to transform the source data into the format required by the result set.</li>
<li>The query optimizer analyzes different ways the source tables can be accessed and create an optimized version of the query tree is called the execution plan.</li>
<li>The relational engine starts executing the execution plan.</li>
<li>The relational engine processes the data and returns the result set to the client.</li>
</ul>
<p><strong>What is Query Plan?</strong></p>
<blockquote><p>The bulk of the execution plan is a re-entrant, read-only data structure used by any number of users. This is referred to as the query plan. No user context is stored in the query plan. There are never more than one or two copies of the query plan in memory.</p></blockquote>
<p><strong>What is Execution Context?</strong></p>
<blockquote><p>Each user that is currently executing the query has a data structure that holds the data specific to their execution, such as parameter values. This data structure is referred to as the execution context.</p></blockquote>
<p><strong>How SQL Server uses procedure cache?</strong></p>
<blockquote><p>When any SQL statement is executed, it first looks through the procedure cache to verify that an existing execution plan for the same SQL statement exists.</p>
<p>It reuses any existing plan it finds, saving the overhead of recompiling the SQL statement</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-1)</title>
		<link>https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 25 May 2016 18:22:10 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[page]]></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[Storage]]></category>
		<category><![CDATA[transaction]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2881</guid>

					<description><![CDATA[Tell me something about the SQL Server Pages. In SQL Server, the page size is 8 KB. This means SQL Server databases have 128 pages per megabyte. Each page begins with a 96-byte header that is used to store system information about the page. This information includes the page number, page type, the amount of [&#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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%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%2F05%2Fsql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1%2F&#038;title=SQL%20Server%3A%20Internal%20Storage%20and%20Memory%20Architecture%20Interview%20Questions%20and%20Answers%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/05/sql-server-internal-storage-and-memory-architecture-interview-questions-and-answers-day-1/" data-a2a-title="SQL Server: Internal Storage and Memory Architecture Interview Questions and Answers (Day-1)"></a></p><p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-the-internal-structure-of-the-data-page/" target="_blank">Tell me something about the SQL Server Pages.</a></strong></p>
<blockquote><p>In SQL Server, the page size is 8 KB. This means SQL Server databases have 128 pages per megabyte. Each page begins with a 96-byte header that is used to store system information about the page. This information includes the page number, page type, the amount of free space on the page, and the allocation unit ID of the object that owns the page.</p></blockquote>
<p><strong>What is a row offset of pages?</strong></p>
<blockquote><p>For each data row there is a 2-byte entry, saving the offset.</p>
<p>A row offset table starts at the end of the page, and each row offset table contains one entry for each row on the page.</p></blockquote>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/" target="_blank">What is the ROW_OVERFLOW_DATA allocation unit?</a></strong></p>
<blockquote><p>When the total row size of all fixed and variable columns in a table exceeds the 8,060 byte limitation, SQL Server dynamically moves one or more variable length columns to pages in the ROW_OVERFLOW_DATA allocation unit, starting with the column with the largest width.</p></blockquote>
<p><strong>What is a IN_ROW_DATA allocation unit?</strong></p>
<blockquote><p>It is an allocation unit for data page and index page.</p></blockquote>
<p><strong>What is a LOB_DATA allocation unit?</strong></p>
<blockquote><p>It is an allocation unit for text, ntext, image, xml, varchar (max), nvarchar (max), varbinary (max) data types.</p></blockquote>
<p><strong>Why 24-byte pointer is require with the ROW_OVERFLOW_DATA allocation unit?</strong></p>
<blockquote><p>When a combination of varchar, nvarchar, varbinary, sql_variant, or CLR user-defined type columns exceeds this 8KB limit, the Database Engine moves the record column with the largest width to another page in the ROW_OVERFLOW_DATA allocation unit, while maintaining a 24-byte pointer on the original page.</p></blockquote>
<p><strong>What is the size of the data page header?</strong></p>
<blockquote><p>The size of the data page header is 96-byte.</p></blockquote>
<p><strong>What are the different types of pages and what do they store?</strong></p>
<ul>
<li>Page types include</li>
<li>Data page</li>
<li>Index page</li>
<li>Text/Image page</li>
<li>Page Free Space</li>
<li>Global Allocation Map (GAM) &#8211; extent allocation information</li>
<li>Shared Global Allocation Map (SGAM) &#8211; mixed extent with at least one unused page information</li>
<li>Bulk Changed Map &#8211; extents that got changed by a bulk logged operation</li>
<li>Differential Changed Map &#8211; extents that got changed since last BACKUP DATABASE statement</li>
<li>Index allocation map</li>
</ul>
<p><strong><a href="https://www.dbrnd.com/2016/04/sql-server-understanding-the-role-of-extent/" target="_blank">What is an Extent?</a></strong></p>
<blockquote><p>Extents are the basic unit in which space is managed. An extent is eight physically contiguous pages, or 64 KB. This means SQL Server databases have 16 extents per megabyte.</p></blockquote>
<p><strong>What are the different types of Extents?</strong></p>
<ul>
<li>Uniform extents are owned by a single object; all eight pages in the extent can only be used by the owning object.</li>
<li>Mixed extents are shared by up to eight objects. Each of the eight pages in the extent can be owned by a different object.</li>
</ul>
<p><strong>What are the different types of database files in SQL Server?</strong></p>
<ul>
<li>Primary data files: The primary data file is the starting point of the database and points to the other files in the database. Every database has one primary data file. The recommended file name extension for primary data files is .mdf.</li>
<li>Secondary data files: Secondary data files make up all the data files, other than the primary data file. Some databases may not have any secondary data files, while others have several secondary data files. The recommended file name extension for secondary data files is .ndf.</li>
<li>Log files: Log files hold all the log information that is used to recover the database. There must be at least one log file for each database, although there can be more than one. The recommended file name extension for log files is .ldf.</li>
</ul>
<p><strong>Explained something about SQL Server Access Methods.</strong></p>
<ul>
<li>SQL doesn’t directly retrieve from disk, it makes requests to buffer manager which serves up the page in cache before rendering out.</li>
<li>When scan starts, SQL Server can use look-ahead mechanisms to qualify rows and index entries on a page. The retrieving of rows that meet specified criteria is known as a qualified retrieval.</li>
</ul>
<p><strong>Tell us something about the SQL Server Database Transactions.</strong></p>
<ul>
<li>Provides support for Atomicity, Consistency, Isolation and Durability.</li>
<li>Log records are always written to disk before the data pages where changes were made are actually written.</li>
<li>Writes to the transaction log are synchronous while writes to data pages can be asynchronous.</li>
</ul>
<p><strong>What is the sparse file?</strong></p>
<blockquote><p>A database snapshot that is created by a user stores its data in one or more sparse files. Sparse file technology is a feature of the NTFS file system.</p></blockquote>
<p><strong>What is the Database Filegroups?</strong></p>
<blockquote><p>Database objects and files can be grouped together in filegroups for allocation and administration purposes.</p></blockquote>
<p><strong>What are the different type of Filegroups?</strong></p>
<ul>
<li>Primary: The primary filegroup contains the primary data file and any other files not specifically assigned to another filegroup.</li>
<li>User-defined: User-defined filegroups are any filegroups that are specified by using the FILEGROUP keyword in a CREATE DATABASE or ALTER DATABASE statement.</li>
</ul>
<p><strong>What are Page Splits?</strong></p>
<blockquote><p>When there is not enough room on a page for a new row, a server splits the page, allocates a new page, and moves some rows to the new page.</p>
<p>Page splits are considered as a very bad performance and there are number of techniques which is used to reduce the risk of page splits.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>NoSQL: Cassandra Architecture &#8211; Read and Write operations in The Ring (Day 2)</title>
		<link>https://www.dbrnd.com/2016/04/nosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 28 Apr 2016 21:14:40 +0000</pubDate>
				<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cluster Ring]]></category>
		<category><![CDATA[Column Store]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[Graph Store]]></category>
		<category><![CDATA[Key Value Store]]></category>
		<category><![CDATA[Memtable]]></category>
		<category><![CDATA[Not Only SQL]]></category>
		<category><![CDATA[SSTable]]></category>
		<category><![CDATA[Unstrucutred]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2708</guid>

					<description><![CDATA[In the previous day, I shared some of the essential key concepts of the Cassandra Architecture. In this post, I am sharing the basic architecture of reading and writing operations of Cassandra. Cassandra Ring: Cassandra is using a consistent hashing algorithm to treat all nodes of the cluster equally. A Cassandra cluster is visualised as [&#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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&amp;linkname=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%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%2F04%2Fnosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2%2F&#038;title=NoSQL%3A%20Cassandra%20Architecture%20%E2%80%93%20Read%20and%20Write%20operations%20in%20The%20Ring%20%28Day%202%29" data-a2a-url="https://www.dbrnd.com/2016/04/nosql-cassandra-architecture-read-and-write-operations-in-the-ring-day-2/" data-a2a-title="NoSQL: Cassandra Architecture – Read and Write operations in The Ring (Day 2)"></a></p><p><em>In the previous day, I shared some of the essential key concepts of the Cassandra Architecture.<br />
In this post, I am sharing the basic architecture of reading and writing operations of Cassandra. </em></p>
<p><strong>Cassandra Ring:</strong></p>
<blockquote><p>Cassandra is using a consistent hashing algorithm to treat all nodes of the cluster equally.</p>
<p><a href="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing.jpg" rel="attachment wp-att-2715"><img loading="lazy" decoding="async" class="alignleft wp-image-2715 size-medium" title="NoSQL Cassandra Ring" src="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-300x239.jpg" alt="NoSQL Cassandra Ring" width="300" height="239" srcset="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-300x239.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-768x613.jpg 768w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-1024x817.jpg 1024w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-750x598.jpg 750w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraRing-150x120.jpg 150w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>A Cassandra cluster is visualised as a Ring in which different nodes are participating with the same name. It can exchange state information with a maximum of three other nodes.<br />
A token range assigns to each node which determines its position in the cluster.</p></blockquote>
<blockquote><p>Cassandra is using Gossip Protocol so whenever any node starts, it obtains information about the other nodes by exchanging information with each other.</p></blockquote>
<blockquote><p>A Partitioner is responsible for preparing the set of data for each node.<br />
Cassandra has three different types of Partitioners, Murmur3Partitioner (default), RandomPartitioner and a ByteOrderedPartitioner.</p></blockquote>
<blockquote><p>Each node is performing replications of data basis on defined replication strategy. Basically there two types of replication strategy, one is Simple Strategy and second is Network Topology Strategy.</p>
<p>A Simple Strategy works in the clockwise, and Network Topology works for multiple data centres.</p></blockquote>
<p><strong>How it executes Write Operations?</strong></p>
<blockquote><p>A Cassandra is Masterless distributed architecture, and there is no any Master and Slave mechanism like any other distributed system.</p>
<p><a href="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture.jpg" rel="attachment wp-att-2720"><img loading="lazy" decoding="async" class="alignright wp-image-2720 size-medium" title="NoSQL Cassandra Architecture" src="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-300x264.jpg" alt="NoSQL Cassandra Architecture" width="300" height="264" srcset="https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-300x264.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-768x675.jpg 768w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-1024x900.jpg 1024w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-750x659.jpg 750w, https://www.dbrnd.com/wp-content/uploads/2016/04/NoSQLCassandraArchitecture-150x132.jpg 150w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p></blockquote>
<blockquote><p>At any given point in time, the client can connect to any node and that connected node called as a coordinator.<br />
Based on the partition key and replication strategy, Coordinator forwards and replicates data to all applicable nodes.</p></blockquote>
<blockquote><p>Each node processes the request individually.<br />
Every node first writes data into the commit log and then writes into the memtable.</p></blockquote>
<blockquote><p>The commit log ensures the durability because memtable is dealing with memory so whenever data is lost then we can use commit log to restore the data.<br />
Whenever memtable is flushed or full, it is written to the SSTable (Sorted String Table) of the disk.</p></blockquote>
<blockquote><p>Every SSTable creates three files on the disk which include a bloom filter, a key index and a data file. Over a period, a number of SSTables are created.</p></blockquote>
<p><strong>How It executes Read Operations?</strong></p>
<blockquote><p>As Cassandra is Masterless architecture so clients can connect to any node of the cluster ring.<br />
Like write operation, chosen node is called as coordinator and is responsible for returning the requested data.</p></blockquote>
<blockquote><p>A row key must be supplied for every read operation. The coordinator uses the row key to determine the first replica.</p>
<p>If replica has a different version of the data, coordinator returns the latest version to the client by issuing read repair command with the older version of the data.</p></blockquote>
<blockquote><p>Each read request fetches the data from memtable and SSTables after that it merged this data and returned to the coordinator.<br />
Internally SSTables are using a Bloom Filter to check requested row key whether it exists in SSTable or not.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
