<?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>concurrency &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/concurrency/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 05:58:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.5</generator>
	<item>
		<title>Database Theory: What is difference between MySQL and PostgreSQL?</title>
		<link>https://www.dbrnd.com/2016/12/database-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 01 Dec 2016 03:34:20 +0000</pubDate>
				<category><![CDATA[Database Theory]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database concept]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database standards]]></category>
		<category><![CDATA[database topic]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[Multi version concurrency control]]></category>
		<category><![CDATA[MVCC]]></category>
		<category><![CDATA[MyISAM]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3960</guid>

					<description><![CDATA[As a database professional, I work with both databases on a regular basis, and I typically use all the features of both databases for design and implementation. I have got many replies to write about the core differences between PostgreSQL and MySQL. As innovation on these databases has progressed, each development community has actively made [&#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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&amp;linkname=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%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%2F12%2Fdatabase-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance%2F&#038;title=Database%20Theory%3A%20What%20is%20difference%20between%20MySQL%20and%20PostgreSQL%3F" data-a2a-url="https://www.dbrnd.com/2016/12/database-theory-what-is-difference-between-mysql-and-postgresql-relational-database-system-concurrency-performance/" data-a2a-title="Database Theory: What is difference between MySQL and PostgreSQL?"></a></p><p><em>As a database professional, I work with both databases on a regular basis, and I typically use all the features of   both databases for design and implementation.<br />
I have got many replies to write about the core differences between PostgreSQL and MySQL. </p>
<p>As innovation on these databases has progressed, each development community has actively made changes to address their respective sets of perceived disadvantages.<br />
The result that it has gotten more difficult to objectively determine which database is likely to be better suited for a given application. </em></p>
<blockquote><p>MySQL is controlled by Oracle, whereas Postgres is available under an open-source license from the PostgreSQL Global Development Group.</p></blockquote>
<blockquote><p>PostgreSQL is closer to the ANSI SQL standard, MySQL is closer to the ODBC standard.</p></blockquote>
<blockquote><p>One of the most notable differences between MySQL and PostgreSQL is the fact that you can’t do nested subqueries of subselects in MySQL. MySQL doesn’t support CTE, window functions, full outer joins and arrays. </p></blockquote>
<blockquote><p>Compare to PostgreSQL, MySQL has its own large user community and various type of materials.</p></blockquote>
<blockquote><p>MySQL uses nonstandard &#8216;#&#8217; to begin a comment line and PostgreSQL use &#8216;&#8211;&#8216; to begin a comment line.</p></blockquote>
<blockquote><p>MySQL provides different type of table storage engines like: InnoDB, MyIsam, Memory. PostgreSQL does not provide different type of table stroage engines.
</p></blockquote>
<blockquote><p>PostgreSQL is case-sensitive for string comparisons. The field &#8220;DbRnd&#8221; is not the same as the field &#8220;dbrnd&#8221;. This is a big change for many users from MySQL and other small database systems.</p></blockquote>
<blockquote><p>PostgreSQL has some nice features like: generate_series, custom aggregate functions, arrays etc. other hand MySQL has also some nice feature like: session variables in queries, FORCE INDEX, etc.</p></blockquote>
<blockquote><p>In PostgreSQL, when you are inside a transaction almost any operation can be undone. There are some irreversible operations (like creating or destroying a database or tablespace), but normal table modifications can be backed out by issuing a ROLLBACK via its Write-Ahead Log design.</p>
<p>MySQL doesn&#8217;t support any sort of rollback when using MyISAM. With InnoDB, the server has an implicit commit that occurs even if the normal auto-commit behavior is turned off. This means that any single table alteration or similar change is immediately committed.</p></blockquote>
<blockquote><p>Postgres obliterates MySQL in all manner of query-level goodness, and we can use Postgres for data mining and batch analytics databases, where we run lots of very large, hand-coded queries that can take advantage of Postgres’ advantages in join methods (MySQL only supports Nested Loop and Nested Loop over Index, while Postgres supports numerous methods), generally richer querying capabilities, and other good stuff like partial indexes can be used extensively.</p></blockquote>
<blockquote><p>PostgreSQL uses a robust locking model called MVCC that limits situations where individual clients interfere with each other. A short summary of the main benefit of MVCC would be &#8220;readers are never blocked by writers&#8221;.</p>
<p>MySQL&#8217;s InnoDB implements MVCC using a rollback segment and InnoDB databases supports all four SQL standard transaction isolation levels.
</p></blockquote>
<blockquote><p>PostgreSQL uses cost-based query optimization methods in order to get good performance for many different types of joins. Query costs are assessed based on planner statistics collected when tables are analyzed combined with adjustable planner costs and advanced features such as the Genetic Query Optimizer.</p>
<p>MySQL doesn&#8217;t have this level of sophistication in its planner, and the tunables for Controlling Query Optimizer Performance are crude. Developers instead do things like explicitly provide index hints to make sure joins are executed correctly.</p></blockquote>
<blockquote><p>PostgreSQL has different replication options than MySQL. MySQL has no point-in-time recovery.</p></blockquote>
<blockquote><p>One operation that PostgreSQL is known to be slow performing is doing a full count of rows in a table, typically using this SQL:</p>
<pre class="crayon-plain-tag">SELECT COUNT(*) FROM your_table_name;</pre> </p>
<p>The reason why this is slow is related to the MVCC implementation in PostgreSQL. The fact that multiple transactions can see different states of the data means that there can be no straightforward way for &#8220;COUNT(*)&#8221; to summarize data across the whole table; PostgreSQL must walk through all rows, in some sense.</p>
<p>In MySQL, MyISAM tables cache the row count information, making this type of count operation almost instant. But if you&#8217;re using InnoDB instead, this is no longer the case and on InnoDB can&#8217;t assume that a full row count will be fast.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-4)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 07 Jun 2016 05:25:29 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DeadLock]]></category>
		<category><![CDATA[DEADLOCK_PRIORITY]]></category>
		<category><![CDATA[explicit locking]]></category>
		<category><![CDATA[implicit locking]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[LOCK_TIMEOUT]]></category>
		<category><![CDATA[Multiversion Concurrency Control]]></category>
		<category><![CDATA[MVCC]]></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=2925</guid>

					<description><![CDATA[Which two isolation levels support optimistic/row-versioned-based concurrency control? First is READ COMMITTED and Second is SNAPSHOT Isolation level. What is the size of a lock structure? The size of lock structure is 96 bytes. Which isolation level is using key-range lock? The SERIALIZABLE isolation level is using key-range lock. Can deadlocks occur on resources other [&#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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%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-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4%2F&#038;title=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-4%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-key-range-lock-deadlock_priority-lock_timeout-mvcc-day-4/" data-a2a-title="SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-4)"></a></p><p><strong>Which two isolation levels support optimistic/row-versioned-based concurrency control?</strong></p>
<blockquote><p>First is READ COMMITTED and Second is SNAPSHOT Isolation level.</p></blockquote>
<p><strong>What is the size of a lock structure?</strong></p>
<blockquote><p>The size of lock structure is 96 bytes.</p></blockquote>
<p><strong>Which isolation level is using key-range lock?</strong></p>
<blockquote><p>The SERIALIZABLE isolation level is using key-range lock.</p></blockquote>
<p><strong>Can deadlocks occur on resources other than a database object and if it YES, what are that other resources?</strong></p>
<blockquote><p>YES, deadlock can occur on other resources like: worker threads, Memory, Parallel query execution related resources, Multiple Active Result Sets resources.</p></blockquote>
<p><strong>When to use Lock Pages in Memory with SQL Server?</strong></p>
<blockquote><p>The Lock Pages in Memory user right is a good performance optimization practice when Tier 1 mission-critical SQL Server. When setting the SQL Server Lock Pages in Memory user right, the virtual machine’s memory reservation should also be set to match the amount of the provision memory.</p></blockquote>
<p><strong>What is the use of DEADLOCK_PRIORITY option?</strong></p>
<blockquote><p>SET DEADLOCK_PRIORITY is set at execute or run time and not at parse time.</p>
<p>If the sessions have different deadlock priorities, the session with the lowest deadlock priority is chosen as the deadlock victim.</p></blockquote>
<p><strong>What is the use of LOCK_TIMEOUT option?</strong></p>
<blockquote><p>It is the number of milliseconds that will pass before Microsoft SQL Server returns a locking error.</p>
<p>A value of -1 (default) indicates no time-out period and value of 0 means to not wait at all and return a message as soon as a lock is encountered.</p></blockquote>
<p><strong>How to check the value of LOCK_TIMEOUT?</strong></p><pre class="crayon-plain-tag">SELECT @@LOCK_TIMEOUT
GO</pre><p>
<strong>How you can set maximum number of available locks to minimize the memory usage?</strong></p>
<blockquote><p>You can use sp_configure to set a locks value.</p>
<p>Below is a T-SQL Script to set the lock value up to 20000.</p><pre class="crayon-plain-tag">Use AdventureWorks2012;
GO
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'locks', 20000;
GO
RECONFIGURE;
GO</pre><p>
</p></blockquote>
<p><strong>Which steps should be taken to address common deadlock issues?</strong></p>
<ul>
<li>Understand which tables are involved in the deadlocks.</li>
<li>Understand which pieces of code correspond to the deadlock and which users execute those pieces of code.</li>
<li>Understand how the application is affected when a deadlock occurs.</li>
<li>Determine the length of the transaction.</li>
<li>Determine if the tables are highly fragmented and causing unnecessary page reads to complete the transaction.</li>
<li>Determine if the tables can be redesigned to prevent deadlocking.</li>
<li>Determine if additional or less indexes would improve the deadlocking.</li>
<li>Determine if the code accesses the tables in the same order and with a similar query plan.</li>
</ul>
<p><strong>Can we capture deadlock information in the XML File format?</strong></p>
<blockquote><p>SQL Server Profiler has the ability to capture the deadlock related information as XML files which can be analyzed to determine the overall locking and blocking issue.</p></blockquote>
<p><strong>What are the features of XML Deadlock File?</strong></p>
<ul>
<li>The XML Deadlocks feature gives you the ability to capture the deadlock related information and review the deadlocks independent of the Profiler interface.</li>
<li>Each of the deadlock files can be analyzed in order to determine trends with the deadlocks on your SQL Server.</li>
<li>Each deadlock situation can be stored in a separate file for per deadlock analysis.</li>
<li>The XML format gives you the ability to programmatically review the deadlocks.</li>
</ul>
<p><strong>What is the Multiversion Concurrency Control (MVCC)?</strong></p>
<blockquote class="wp-embedded-content" data-secret="PKYLojy76x"><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=PKYLojy76x" data-secret="PKYLojy76x" 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>
<p><strong>What is the Implicit Locking?</strong></p>
<blockquote><p>Implicit Lock means Lock is implied but is not acquired.</p>
<p>The Database will implicitly obtain the appropriate locks for your application at the point at which they are needed. An operation that reads an object will obtain a read lock; an operation that modifies an object will obtain a write lock.</p></blockquote>
<p><strong>What is the Explicit Locking?</strong></p>
<blockquote><p>Explicit Lock means Lock is explicitly requested for a record or table.</p>
<p>An application needing to reserve access to all required objects in advance can explicitly lock objects.</p>
<p>Explicit locking effectively freezes the objects, because no other session can modify them as long as they are locked.</p></blockquote>
<p><strong>I am confused between UPDLOCK and HOLDLOCK, would you please help me?</strong></p>
<blockquote><p>UPDLOCK does not block concurrent SELECT nor INSERT, but blocks any UPDATE or DELETE of the rows selected by T1.</p>
<p>HOLDLOCK means SERALIZABLE and therefore allows SELECTS, but blocks UPDATE and DELETES of the rows selected by T1, as well as any INSERT in the range selected by T1.</p></blockquote>
<p><strong>What is the meaning of wait and await in the Deadlock situation?</strong></p>
<blockquote><p>wait will synchronously block until the task completes. So the current thread is literally blocked waiting for the task to complete. As a general rule, you should use &#8220;async all the way down&#8221;; that is, don&#8217;t block on async code.</p>
<p>await will asynchronously wait until the task completes. This means the current method is &#8220;paused&#8221; (its state is captured) and the method returns an incomplete task to its caller. Later, when the await expression completes, the remainder of the method is scheduled as a continuation.</p></blockquote>
<p><strong>What is a Transaction in SQL Server ?</strong></p>
<blockquote><p>Transaction groups a set of T-Sql Statements into a single execution unit. Each transaction begins with a specific task and ends when all the tasks in the group successfully complete. If any of the tasks fails, the transaction fails. Therefore, atransaction has only two results: success or failure.</p></blockquote>
<p><strong>What are the types of Transactions?</strong></p>
<blockquote><p>Implicit – Specifies any Single Insert,Update or Delete statement as Transaction Unit.  No need to specify Explicitly.</p>
<p>Explicit – A group of T-Sql statements with the beginning and ending marked with Begin Transaction,Commit and RollBack. PFB an Example for Explicit transactions.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-3)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 06 Jun 2016 17:52:37 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DeadLock]]></category>
		<category><![CDATA[interivews]]></category>
		<category><![CDATA[Isolation]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[Lock escalation]]></category>
		<category><![CDATA[locking hints]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[spin lock]]></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[TSQL]]></category>
		<category><![CDATA[WITH (NOLOCK)]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2922</guid>

					<description><![CDATA[Database session A tries to update some data that is already locked by database session B. What happens to session A? The session A will actually be placed in what’s called a lock wait state, and session A will be stopped from making further progress with any SQL transaction that it’s performing. Another way of saying [&#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-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3%2F&#038;title=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-3%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-locking-hints-escalation-spinlock-day-3/" data-a2a-title="SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-3)"></a></p><p><strong>Database session A tries to update some data that is already locked by database session B. </strong><strong>What happens to session A?</strong></p>
<blockquote><p>The session A will actually be placed in what’s called a lock wait state, and session A will be stopped from making further progress with any SQL transaction that it’s performing. Another way of saying this is that session A will be “stalled” until session B releases the lock on that data.</p></blockquote>
<p><strong>What is lock contention?</strong></p>
<blockquote><p>One problem that occurs with having locks is that locks can cause what’s known as contention.</p>
<p>In the best case, lock contention means that some user processes run slower because a session is waiting for a lock. In the worst case, having sessions compete for locks can make sessions stall for an indefinite period of time.</p></blockquote>
<p><strong>What is Locking Hints option?</strong></p>
<blockquote><p>Locking hints can be specified for individual table references in the SELECT, INSERT, UPDATE, and DELETE statements. The hints specify the type of locking or row versioning the instance of the SQL Server Database Engine uses for the table data.</p></blockquote>
<p><strong>Does Locking hints override the current transaction isolation level?</strong></p>
<blockquote><p>Yes, The Locking hints override the current transaction isolation level for the session.</p></blockquote>
<p><strong>What is WITH (NOLOCK)?</strong></p>
<blockquote><p>It is equivalent to READUNCOMMITTED isolation level and you can SELECT table dirty data which are not yet committed.</p></blockquote>
<p><strong>What is WITH (NOWAIT)?</strong></p>
<blockquote><p>It instructs the Database Engine to return a message as soon as a lock is encountered on the table. NOWAIT is equivalent to specifying SET LOCK_TIMEOUT 0 for a specific table.</p></blockquote>
<p><strong>What is WITH (ROWLOCK)?</strong></p>
<blockquote><p>It specifies that row locks are taken when page or table locks are ordinarily taken.</p></blockquote>
<p><strong>What is WITH (TABLOCK)?</strong></p>
<blockquote><p>Specifies that the acquired lock is applied at the table level. The type of lock that is acquired depends on the statement being executed.</p></blockquote>
<p><strong>What is WITH (UPDLOCK)?</strong></p>
<blockquote><p>It specifies that update locks are to be taken and held until the transaction completes. UPDLOCK takes update locks for read operations only at the row-level or page-level.</p></blockquote>
<p><strong>What is the use of sys.dm_tran_locks?</strong></p>
<blockquote><p>You can query the sys.dm_tran_locks dynamic management view to obtain information about the current state of locking in an instance of the Database Engine.</p></blockquote>
<p><strong>What is a Lock Escalation?</strong></p>
<blockquote><p>A query might have a resource locked for &#8220;shared&#8221; and escalate it to &#8220;exclusive&#8221; to perform an update. SQL Server does Lock Escalation in order to reduce memory overhead, by converting several fine-grained low level locks to coarse-grained high level locks. Page Locks are also escalated to Table Locks.</p></blockquote>
<p><strong>What is the Spinlock?</strong></p>
<blockquote><p>It controls access to a lock resource, such as a row or a table.</p>
<p>Without lock partitioning, one spinlock manages all lock requests for a single lock resource.</p>
<p>To reduce contention on a single lock resource, lock partitioning splits a single lock resource into multiple lock resources to distribute the load across multiple spinlocks.</p></blockquote>
<p><strong>How READ_COMMITTED internally implemented row level locks?</strong></p>
<blockquote><p>When SQL Server executes a statement at the read committed isolation level, it acquires short lived share locks on a row by row basis. The duration of these share locks is just long enough to read and process each row; the server generally releases each lock before proceeding to the next row.</p></blockquote>
<p><strong>Within the REPEATABLE_READ and SERIALIZABLE isolation levels, during a read operation and assuming row-level locking, how long are locks held or retained for?</strong></p>
<blockquote><p>Answer: Within either of these isolation levels, locks are held for the duration of the transaction, unlike within the READ_COMMITTED isolation level.</p></blockquote>
<p><strong>When Lock escalation is triggered?</strong></p>
<blockquote><p>When a single Transact-SQL statement acquires at least 5,000 locks on a single table or index.</p>
<p>When the number of locks in an instance of the Database Engine exceeds memory or configuration thresholds.</p>
<p>If locks cannot be escalated because of lock conflicts, the Database Engine periodically triggers lock escalation at every 1,250 new locks acquired.</p></blockquote>
<p><strong>Name as many of the lockable resources of the SQL Server.</strong></p>
<ul>
<li>RID (single row on a heap)</li>
<li>KEY (single row (or range) on an index)</li>
<li>PAGE</li>
<li>EXTENT</li>
<li>HOBT (heap or b-tree)</li>
<li>TABLE (entire table, all data and indexes)</li>
<li>FILE</li>
<li>APPLICATION</li>
<li>METADATA</li>
<li>ALLOCATION_UNIT</li>
<li>DATABASE</li>
</ul>
<p><strong>What is the least restrictive and the most restrictive type of lock?</strong></p>
<blockquote><p>The least restrictive type of lock is a shared lock. The most restrictive type of lock is a schema-modification.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-2)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 05 Jun 2016 17:55:04 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DeadLock]]></category>
		<category><![CDATA[exclusive lock]]></category>
		<category><![CDATA[intent lock]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[Isolation]]></category>
		<category><![CDATA[live lock]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[lock partitioning]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[schema lock]]></category>
		<category><![CDATA[shared lock]]></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>
		<category><![CDATA[update lock]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2919</guid>

					<description><![CDATA[What is the Read Uncommitted Isolation Level of the SQL Server? SQL Server: What is Read Uncommitted Isolation Level? &#160; What is the READ COMMITTED Isolation Level of the SQL Server? SQL Server: READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option &#160; What is the READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option? When 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%2F2016%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2%2F&#038;title=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-shared-update-exclusive-live-schema-intent-lock-day-2/" data-a2a-title="SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-2)"></a></p><p><strong>What is the Read Uncommitted Isolation Level of the SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="845OXYLMTN"><p><a href="https://www.dbrnd.com/2016/04/sql-server-what-is-read-uncommitted-isolation-level/">SQL Server: What is Read Uncommitted Isolation Level?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-what-is-read-uncommitted-isolation-level/embed/#?secret=845OXYLMTN" data-secret="845OXYLMTN" width="600" height="338" title="&#8220;SQL Server: What is Read Uncommitted Isolation Level?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<p><strong>What is the READ COMMITTED Isolation Level of the SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="Acks8yi2wc"><p><a href="https://www.dbrnd.com/2016/04/sql-server-read-committed-isolation-level-with-the-read_committed_snapshot-option/">SQL Server: READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-read-committed-isolation-level-with-the-read_committed_snapshot-option/embed/#?secret=Acks8yi2wc" data-secret="Acks8yi2wc" width="600" height="338" title="&#8220;SQL Server: READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<p><strong>What is the READ COMMITTED Isolation Level with the READ_COMMITTED_SNAPSHOT option?</strong></p>
<blockquote><p>When the READ_COMMITTED_SNAPSHOT database option is ON, read committed isolation uses row versioning.</p>
<p>READ COMMITTED SNAPSHOT does optimistic reads and pessimistic writes. When data is updating, you can still read old version of data and there is no any share lock, but you cannot update that same data until the running update is not finished.</p></blockquote>
<p><strong>What is the REPEATABLE READ Isolation Level of the SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="LqSBNPx9h7"><p><a href="https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/">SQL Server: What is REPEATABLE READ Isolation Level?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-what-is-repeatable-read-isolation-level/embed/#?secret=LqSBNPx9h7" data-secret="LqSBNPx9h7" width="600" height="338" title="&#8220;SQL Server: What is REPEATABLE READ Isolation Level?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<p><strong>What is the SERIALIZABLE Isolation level of the SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="bgNGRhASFf"><p><a href="https://www.dbrnd.com/2016/04/sql-sever-what-is-serializable-isolation-level/">SQL Sever: What is SERIALIZABLE Isolation level?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-sever-what-is-serializable-isolation-level/embed/#?secret=bgNGRhASFf" data-secret="bgNGRhASFf" width="600" height="338" title="&#8220;SQL Sever: What is SERIALIZABLE Isolation level?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is the SNAPSHOT Isolation Level of the SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="bvolybPzQT"><p><a href="https://www.dbrnd.com/2016/04/sql-server-what-is-snapshot-isolation-level/">SQL Server: What is SNAPSHOT Isolation Level?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-what-is-snapshot-isolation-level/embed/#?secret=bvolybPzQT" data-secret="bvolybPzQT" width="600" height="338" title="&#8220;SQL Server: What is SNAPSHOT Isolation Level?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<p><strong>Can you enable SNAPSHOT Isolation Level for a particular SQL statement?</strong></p>
<blockquote><p>You cannot enable SNAPSHOT Isolation level at statement level.</p>
<p>You have to enable at the database level and after enabling all your database transactions will execute in MVCC fashion.</p></blockquote>
<p><strong>What is the difference between READ_COMMITTED_SNAPSHOT option and Snapshot Isolation Level?</strong></p>
<blockquote><p>Using READ_COMMITTED_SNAPSHOT option, you can SELECT old version of rows while it is updating, but you cannot execute new UPDATE on the same data until it finished a running UPDATE.</p>
<p>Using SNAPSHOT ISOLATION LEVEL, you can perform any kind of DML operation because it is managing different data version in the TempDB so the reader and writer never blocked by each other.</p></blockquote>
<p><strong>What is a Shared lock?</strong></p>
<blockquote><p>Shared (S): Used for read operations that do not change or update data, such as a SELECT statement.</p></blockquote>
<p><strong>What is an Update lock?</strong></p>
<blockquote><p>Update(U): Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later.</p></blockquote>
<p><strong>What is an Exclusive lock?</strong></p>
<blockquote><p>Exclusive(X): Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.</p></blockquote>
<p><strong>What is an Intent lock?</strong></p>
<blockquote><p>The Database Engine uses intent locks to protect placing a shared (S) lock or exclusive (X) lock on a resource lower in the lock hierarchy. Intent locks are named intent locks because they are acquired before a lock at the lower level, and therefore signal intent to place locks at a lower level.</p></blockquote>
<p><strong>What is a Schema lock?</strong></p>
<blockquote><p>The Database Engine uses schema modification (Sch-M) locks during a table data definition language (DDL) operation, such as adding a column or dropping a table. During the time that it is held, the Sch-M lock prevents concurrent access to the table.</p></blockquote>
<p><strong>What is a Bulk Update lock?</strong></p>
<blockquote><p>BulkUpdate (BU): Used when bulk copying data into a table and the TABLOCK hint is specified.</p></blockquote>
<p><strong>What is a Key range lock?</strong></p>
<blockquote><p>Key-range locks protect a range of rows implicitly included in a record set being read by a Transact-SQL statement while using the serializable transaction isolation level. Key-range locking prevents phantom reads.</p>
<p>A key range lock protects this requirement by preventing other transactions from inserting new rows whose keys would fall in the range of keys read by the serializable transaction.</p></blockquote>
<p><strong>Do you think lock is reducing the performance of the database system?</strong></p>
<blockquote><p>For large computer systems, locks on frequently referenced objects can become a performance bottleneck as acquiring and releasing locks place contention on internal locking resources.</p></blockquote>
<p><strong>What do you know about the lock partitioning?</strong></p>
<blockquote><p>Lock partitioning enhances locking performance by splitting a single lock resource into multiple lock resources. This feature is only available for systems with 16 or more CPUs, and is automatically enabled and cannot be disabled. Only object locks can be partitioned.</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-1)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1/</link>
					<comments>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 04 Jun 2016 17:52:40 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[acid]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[Check Constraint]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DeadLock]]></category>
		<category><![CDATA[default trace]]></category>
		<category><![CDATA[Dirty read]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[locking]]></category>
		<category><![CDATA[phantom read]]></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[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2916</guid>

					<description><![CDATA[What is the ACID Properties in the Database System? ACID Properties in Database System (Atomicity, Consistency, Isolation, Durability) What is a Phantom read? A phantom read occurs when, in the course of a transaction, two identical queries are executed, and the collection of rows returned by the second query is different from the first. This [&#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-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&amp;linkname=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%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%2F06%2Fsql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1%2F&#038;title=SQL%20Server%3A%20Database%20Lock%2C%20Deadlock%2C%20Block%20and%20Isolation%20Interview%20Questions%20and%20%20%20Answers%20%28Day-1%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1/" data-a2a-title="SQL Server: Database Lock, Deadlock, Block and Isolation Interview Questions and   Answers (Day-1)"></a></p><p><strong>What is the ACID Properties in the Database System?</strong></p>
<blockquote data-secret="GZz3hgbH8E" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2015/05/acid-properties-in-database-system/">ACID Properties in Database System (Atomicity, Consistency, Isolation, Durability)</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/05/acid-properties-in-database-system/embed/#?secret=GZz3hgbH8E" data-secret="GZz3hgbH8E" width="600" height="338" title="&#8220;ACID Properties in Database System (Atomicity, Consistency, Isolation, Durability)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is a Phantom read?</strong></p>
<blockquote><p>A phantom read occurs when, in the course of a transaction, two identical queries are executed, and the collection of rows returned by the second query is different from the first.</p>
<p>This can occur when range locks are not acquired on performing a SELECT &#8230; WHERE operation.</p></blockquote>
<p><strong>What is a Dirty read?</strong></p>
<blockquote><p>Dirty read—Dirty reads occur when one transaction reads data that has been written but not yet committed by another transaction. If the changes are later rolled back, the data obtained by the first transaction will be invalid.</p></blockquote>
<p><strong>What is Nonrepeatable read?</strong></p>
<blockquote><p>Nonrepeatable reads happen when a transaction performs the same query two or more times and each time the data is different. This is usually due to another concurrent transaction updating the data between the queries.</p></blockquote>
<p><strong>What is a lost update problem?</strong></p>
<blockquote><p>Lost updates occur when two or more transactions select the same row and then update the row based on the value originally selected. Each transaction is unaware of other transactions. The last update overwrites updates made by the other transactions, which results in lost data.</p></blockquote>
<p><strong>What is Timeout?</strong></p>
<blockquote data-secret="mv0SEDiAHt" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/04/database-theory-what-is-timeout-lock-block-and-deadlock-in-a-database-system/">Database Theory: What is Timeout, Lock, Block, and Deadlock in a Database System?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/database-theory-what-is-timeout-lock-block-and-deadlock-in-a-database-system/embed/#?secret=mv0SEDiAHt" data-secret="mv0SEDiAHt" width="600" height="338" title="&#8220;Database Theory: What is Timeout, Lock, Block, and Deadlock in a Database System?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is a Lock?</strong></p>
<blockquote><p>When one process is accessing an object, it can request for a lock for that particular object so that other processes cannot perform read or update on that object.</p>
<p>There are different types of lock like: Exclusive Lock, Non-exclusive Lock.</p></blockquote>
<p><strong>What is Blocking?</strong></p>
<blockquote><p>If two processes are accessing same resource so at that time one process has to wait until the other process release the occupied resource.</p>
<p>This is called blocking because one transaction is blocked by another transaction and all blocked processes kept in the waiting queue.</p>
<p>If the blocked transaction is waiting for a long time, it may generate a Database Timeout. If the long running blocked transaction requires a lock, it may generate a Database Deadlock.</p></blockquote>
<p><strong>What is a Deadlock?</strong></p>
<blockquote><p>One X blocked process is waiting to complete the transaction of the Y process and the same time, Y process is blocked because it is also waiting to complete the transaction of the X process.</p>
<p>This is called as Deadlock situation.</p>
<p>Deadlock is a next stage of the blocking situation so if you want to avoid Deadlock situation, you should first find the blocked transaction and tried to remove internal dependency of the transactions.</p></blockquote>
<p><strong>What is a Live lock?</strong></p>
<blockquote><p>A livelock is one, where a request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely.</p></blockquote>
<p><strong>What is Optimistic Locking and Pessimistic Locking?</strong></p>
<blockquote data-secret="i6i2DG1tfR" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/04/database-theory-what-is-optimistic-locking-and-pessimistic-locking/">Database Theory: What is Optimistic Locking and Pessimistic Locking?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/database-theory-what-is-optimistic-locking-and-pessimistic-locking/embed/#?secret=i6i2DG1tfR" data-secret="i6i2DG1tfR" width="600" height="338" title="&#8220;Database Theory: What is Optimistic Locking and Pessimistic Locking?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What are the different ways to detect a deadlock in the SQL Server?</strong></p>
<blockquote data-secret="vINK5fCe3u" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/04/sql-server-8-different-ways-to-detect-a-deadlock-in-a-database/">SQL Server: 8 different ways to Detect a DeadLock in a Database</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-8-different-ways-to-detect-a-deadlock-in-a-database/embed/#?secret=vINK5fCe3u" data-secret="vINK5fCe3u" width="600" height="338" title="&#8220;SQL Server: 8 different ways to Detect a DeadLock in a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What happens after the Deadlock arise in the SQL Server?</strong></p>
<blockquote data-secret="Hkr0ZTvzXa" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/04/sql-server-what-happens-after-the-deadlock-arise/">SQL Server: What happens after the Deadlock arise?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-what-happens-after-the-deadlock-arise/embed/#?secret=Hkr0ZTvzXa" data-secret="Hkr0ZTvzXa" width="600" height="338" title="&#8220;SQL Server: What happens after the Deadlock arise?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is your ultimate strategies to avoid a Deadlock?</strong></p>
<blockquote data-secret="xedNE0qwWw" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/04/database-design-the-ultimate-strategies-to-avoid-deadlock/">Database Design: The Ultimate Strategies to avoid Deadlock</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/database-design-the-ultimate-strategies-to-avoid-deadlock/embed/#?secret=xedNE0qwWw" data-secret="xedNE0qwWw" width="600" height="338" title="&#8220;Database Design: The Ultimate Strategies to avoid Deadlock&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is the Database level Locking?</strong></p>
<blockquote><p>With database level locks, the entire database is locked – which means that only one database session can apply any updates to the database. This type of lock is not often used, because it obviously prevents all users except one from updating anything in the database.</p></blockquote>
<p><strong>What is the File level Locking?</strong></p>
<blockquote><p>With a file lock level, an entire database file is locked. What exactly is a file in a database? Well, a file can have a wide variety of data – inside a file there could be an entire table, a part of a table, or even parts of different tables. Because of the variety of data stored inside a file, this type of lock level is less favored.</p></blockquote>
<p><strong>What is the Column level Locking?</strong></p>
<blockquote><p>A column level lock just means that some columns within a given row in a given table are locked. This form of locking is not commonly used because it requires a lot of resources to enable and release locks at this level. Also, there is very little support for column level locking in most database vendors.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/06/sql-server-database-lock-deadlock-block-and-isolation-interview-questions-and-answers-day-1/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>What is Multi Version Concurrency Control (MVCC)</title>
		<link>https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/</link>
					<comments>https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 30 May 2015 17:29:33 +0000</pubDate>
				<category><![CDATA[Database Theory]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database concept]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database standards]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[Multiversion Concurrency Control]]></category>
		<category><![CDATA[MVCC]]></category>
		<category><![CDATA[RDBMS]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=210</guid>

					<description><![CDATA[In this post, I am sharing a basic note about Multi-version concurrency control and explain how MVCC works. Guys, you can find lots of theory and research on MVCC, but here I shared this theory by giving an easy example What is Multi-version Concurrency Control? : Very simple, &#8221; One record has multiple versions &#8220;. [&#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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&amp;linkname=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%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%2F2015%2F05%2Fwhat-is-mvcc-multi-version-concurrency-control%2F&#038;title=What%20is%20Multi%20Version%20Concurrency%20Control%20%28MVCC%29" data-a2a-url="https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/" data-a2a-title="What is Multi Version Concurrency Control (MVCC)"></a></p><div>
<p>In this post, I am sharing a basic note about Multi-version concurrency control and explain how MVCC works.</p>
<blockquote><p>Guys, you can find lots of theory and research on MVCC, but here I shared this theory by giving an easy example</p></blockquote>
<p><b><br />
What is Multi-version Concurrency Control? :</b></p>
<p><b><span style="color: #6aa84f;">Very simple, &#8221; One record has multiple versions &#8220;. </span></b></p>
</div>
<div>
<blockquote><p>E.g,</p>
<p>User A &#8212;-&gt; inserted one record with ID 1. (stored this into one data page.)</p>
<p>User B &#8212;-&gt; update record for ID 1.</p></blockquote>
<p><strong>Guys, what are you thinking now?</strong></p>
<blockquote><p>One record inserted and updated by another user.</p></blockquote>
<blockquote><p>First inserted, an old version of the record changed by the new update statement and become a new version of the record. But the new version of the record added separately in the data page.</p></blockquote>
<blockquote><p>Whatever different changes occur on the same record, MVCC stored different version for each change which is not an overwritten process but it stores all different versions of records.</p></blockquote>
<blockquote><p>E.g,</p>
<p>You wrote one sentence in your book.</p>
<p><em>The Sentence is : &#8221; I am good database developer &#8220;.</em></p>
<p>Now change this sentence.</p>
<p><em>The Sentence is : &#8221; I am good database administrator &#8220;.</em></p>
<p>Now for that change, you can erase that sentence and change &#8220;developer&#8221; to &#8220;administrator&#8221;.
</p></blockquote>
<blockquote><p><strong>Other database engines also doing the same thing as you do in your real life, but MVCC stored those two sentences with different versions.</strong></p>
<p><em>Old Version : &#8221; I am good database developer &#8220;</em></p>
<p><em>New Version : &#8221; I am good database administrator &#8220;</em></p>
<p>By Default, User can only select a new version of the data.</p>
<p>That&#8217;s the simple definition and example of MVCC.</p></blockquote>
<p><b>Why MVCC ?:</b></p>
<blockquote><p>Let&#8217;s first discuss concurrency, more than one users at the same time accessing the database or records for different purposes.</p></blockquote>
<blockquote><p>MVCC provides concurrent access to the database.</p></blockquote>
<blockquote><p>Let&#8217;s imagine, one user is reading a record and the second user is trying to update the same record. Now reader wants to read that record before completion of the update process.<br />
In this situation, you can allow readers to read uncommitted or inconsistent data which are not updated yet. </p>
<p>Else, You can apply lock, in which all readers have to wait until the update complete.</p></blockquote>
<blockquote><p>But this lock and dirty read is not a proper solution because lock can degrade performance and dirty read is not showing correct data.</p></blockquote>
<blockquote><p><b>In this situation MVCC is the best solution, where readers can see old committed version of data and once the update finished, the reader can see a newly committed version of the data.<br />
The read process and write process never block to each other. </b></p></blockquote>
<blockquote><p>E.g.</p>
<p><em>The reader can read this sentence &#8221; I am database developer. &#8220;</em></p>
<p><em>After update reader can read the new sentence &#8221; I am database administrator. &#8220;</em></p></blockquote>
<p><b><br />
Drawbacks of MVCC :</b></p>
<blockquote><p>The main drawback of MVCC is, it requires more space to store a different version of the data.</p>
<p>Yes, later you can remove an old version of data by specifying cleaning command. But you require more maintenance on those tables for removing the fragmentation which generated by an old version of data.</p>
<p>In the MVCC, the same data causes an update conflict because two different transactions can update the same version of the row.
</p></blockquote>
<p><b><br />
Most MVCC database systems:</b></p>
<p>ORACLE</p>
<p>PostgreSQL</p>
<p>MySQL (only InnoDB engine)</p>
<p>You can also achieve MVCC in Microsoft SQL Server using &#8221; Snapshot Isolation Level &#8220;.</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/05/what-is-mvcc-multi-version-concurrency-control/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
