﻿<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>评论: 位图索引引发的阻塞与死锁</title>
	<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html</link>
	<description>dba on unix</description>
	<pubDate>Thu, 20 Nov 2008 21:01:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>

	<item>
		<title>作者: paul</title>
		<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-410</link>
		<author>paul</author>
		<pubDate>Wed, 16 May 2007 07:24:50 +0000</pubDate>
		<guid>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-410</guid>
					<description>好文章</description>
		<content:encoded><![CDATA[<p>好文章</p>
]]></content:encoded>
				</item>
	<item>
		<title>作者: logzgh</title>
		<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-457</link>
		<author>logzgh</author>
		<pubDate>Wed, 23 May 2007 08:21:55 +0000</pubDate>
		<guid>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-457</guid>
					<description>"假定id=1的的值原来是0，现在要更新成1，那么，这个语句在位图索引中，锁住所有的flag为0以及flag为1的数据，这个是比较恐怖的。更新一行数据相当于锁定了整个索引"

你这里的说法不太正确。
事实上是锁定了id=1那条记录所在的索引块上所包含的所有记录。对大表来讲，一个索引块并不会包含所有的记录，所以不是整个索引。</description>
		<content:encoded><![CDATA[<p>&#8220;假定id=1的的值原来是0，现在要更新成1，那么，这个语句在位图索引中，锁住所有的flag为0以及flag为1的数据，这个是比较恐怖的。更新一行数据相当于锁定了整个索引&#8221;</p>
<p>你这里的说法不太正确。<br />
事实上是锁定了id=1那条记录所在的索引块上所包含的所有记录。对大表来讲，一个索引块并不会包含所有的记录，所以不是整个索引。</p>
]]></content:encoded>
				</item>
	<item>
		<title>作者: piner</title>
		<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-459</link>
		<author>piner</author>
		<pubDate>Wed, 23 May 2007 11:33:04 +0000</pubDate>
		<guid>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-459</guid>
					<description>[quote]“假定id=1的的值原来是0，现在要更新成1，那么，这个语句在位图索引中，锁住所有的flag为0以及flag为1的数据，这个是比较恐怖的。更新一行数据相当于锁定了整个索引”
你这里的说法不太正确。事实上是锁定了id=1那条记录所在的索引块上所包含的所有记录。对大表来讲，一个索引块并不会包含所有的记录，所以不是整个索引。[/quote]

谢谢指正。。。这里我我有时间再实验一下。</description>
		<content:encoded><![CDATA[<p>[quote]“假定id=1的的值原来是0，现在要更新成1，那么，这个语句在位图索引中，锁住所有的flag为0以及flag为1的数据，这个是比较恐怖的。更新一行数据相当于锁定了整个索引”<br />
你这里的说法不太正确。事实上是锁定了id=1那条记录所在的索引块上所包含的所有记录。对大表来讲，一个索引块并不会包含所有的记录，所以不是整个索引。[/quote]</p>
<p>谢谢指正。。。这里我我有时间再实验一下。</p>
]]></content:encoded>
				</item>
	<item>
		<title>作者: piner</title>
		<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-460</link>
		<author>piner</author>
		<pubDate>Wed, 23 May 2007 12:16:03 +0000</pubDate>
		<guid>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-460</guid>
					<description>现在发现，你的说法也不正确，你说锁住id=1的那个索引块，其实，我这里这么少的记录，应当就是一个索引块。

但是，下面的实验可以发现，set flag=2与flag=3是互相不等待的，也就是没有锁等待，按照你的说法，除非只是锁定了这个记录所在的索引块的flag = 新值 与 原值 的所有记录。

现在，我先这么改了，是否正确，我还要验证。</description>
		<content:encoded><![CDATA[<p>现在发现，你的说法也不正确，你说锁住id=1的那个索引块，其实，我这里这么少的记录，应当就是一个索引块。</p>
<p>但是，下面的实验可以发现，set flag=2与flag=3是互相不等待的，也就是没有锁等待，按照你的说法，除非只是锁定了这个记录所在的索引块的flag = 新值 与 原值 的所有记录。</p>
<p>现在，我先这么改了，是否正确，我还要验证。</p>
]]></content:encoded>
				</item>
	<item>
		<title>作者: piner</title>
		<link>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-462</link>
		<author>piner</author>
		<pubDate>Wed, 23 May 2007 12:55:44 +0000</pubDate>
		<guid>http://www.ixdba.com/html/y2007/m05/102-bitmap-index-deadlock.html#comment-462</guid>
					<description>具体位图索引的内部，可以参考
http://www.itpub.net/showthread.php?threadid=743939

其实，锁定范围也可能不仅仅是一个索引块，9i与10g的变化也是比较大的，我们现在只要知道，锁定的范围比较大，不适合频繁修改的oltp即可。</description>
		<content:encoded><![CDATA[<p>具体位图索引的内部，可以参考<br />
<a href="http://www.itpub.net/showthread.php?threadid=743939" rel="nofollow">http://www.itpub.net/showthread.php?threadid=743939</a></p>
<p>其实，锁定范围也可能不仅仅是一个索引块，9i与10g的变化也是比较大的，我们现在只要知道，锁定的范围比较大，不适合频繁修改的oltp即可。</p>
]]></content:encoded>
				</item>
</channel>
</rss>
