<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>B7 Interactive</title>
	<link>http://www.b7interactive.com/blog</link>
	<description>E-Commerce &#124; Web Development &#124; Marketing</description>
	<pubDate>Thu, 10 Jan 2008 03:48:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>MySQL Error 1206 - &#8220;The total number of locks exceeds the lock table size&#8221;</title>
		<link>http://www.b7interactive.com/blog/?p=3</link>
		<comments>http://www.b7interactive.com/blog/?p=3#comments</comments>
		<pubDate>Thu, 03 Jan 2008 05:38:01 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Technical Articles]]></category>

		<category><![CDATA[Databases]]></category>

		<category><![CDATA[innodb]]></category>

		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.b7interactive.com/blog/?p=3</guid>
		<description><![CDATA[Background:
This information in this post applies to MySQL tables using the InnoDB storage engine. I encountered this error when performing a DELETE against a table with millions of rows using a single column WHERE clause that didn&#8217;t leverage any indexes and fairly stock MySQL configuration.
Summary:
InnoDB implements row-level locking by placing locks on index records (called [...]]]></description>
			<content:encoded><![CDATA[<h3>Background:</h3>
<p><em>This information in this post applies to MySQL tables using the InnoDB storage engine. I encountered this error when performing a DELETE against a table with millions of rows using a single column WHERE clause that didn&#8217;t leverage any indexes and fairly stock MySQL configuration.</em><br />
<h3>Summary:</h3>
<p>InnoDB implements row-level locking by placing locks on index records (called next-key locking). These locks are housed in a special locking hash table located within the InnoDB buffer pool. Locking rows consumes a few bits per row (something on the order of 3-4 bits per row). It&#8217;s important to remember that InnoDB will not only lock the matching rows but also the gaps between rows.UPDATE and DELETE statements against an InnoDB table that do no use an index for columns referenced in their WHERE clause will cause all rows in the table to be locked exclusively. To avoid this behavior, an index should be created to accommodate the WHERE clause.<br />
<h3>Possible Solutions:</h3>
<ul>
<li>Break the operation into smaller units of work (i.e. DELETE with a LIMIT clause)</li>
<li>Create an index on the columns used in the WHERE clause</li>
<li>Increase the InnoDB Buffer Pool Size (I personally think this should be a last resort)</li>
</ul>
<h3>Related Posts:</h3>
<ul>
<li><a href="http://mrothouse.wordpress.com/2006/10/20/mysql-error-1206/">&#8220;MySQL Error 1206&#8243; on Mike R’s Blog</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.b7interactive.com/blog/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
	</channel>
</rss>
