<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: OR引起的性能问题, 在表上进行行过滤</title>
	<atom:link href="http://www.anysql.net/dba/index_vs_table_filter.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.anysql.net/dba/index_vs_table_filter.html</link>
	<description>Oracle DBA,MySQL DBA, 数据恢复, 数据迁移, 报表软件, 性能优化, 系统监控</description>
	<lastBuildDate>Wed, 17 Mar 2010 15:20:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jametong</title>
		<link>http://www.anysql.net/dba/index_vs_table_filter.html/comment-page-1#comment-960</link>
		<dc:creator>jametong</dc:creator>
		<pubDate>Sun, 12 Oct 2008 18:44:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/or%e5%bc%95%e8%b5%b7%e7%9a%84%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98-%e5%9c%a8%e8%a1%a8%e4%b8%8a%e8%bf%9b%e8%a1%8c%e8%a1%8c%e8%bf%87%e6%bb%a4.html#comment-960</guid>
		<description>eagle 还是 eygle ?
其实这个例子说明的东西有问题,,两个查询语句基于的数据基础不同.. 不能这样比较啊...
第二个语句有一个前提条件, 这个字段不能为null. 而第一个sql语句并不能确认存在这个约束.. 有些情况下, 即使性能不好也只能这样使用. 宽泛的调优只能在不改变业务性质的情况下进行. 对业务本身进行优化是另外一个问题了.
</description>
		<content:encoded><![CDATA[<p>eagle 还是 eygle ?<br />
其实这个例子说明的东西有问题,,两个查询语句基于的数据基础不同.. 不能这样比较啊&#8230;<br />
第二个语句有一个前提条件, 这个字段不能为null. 而第一个sql语句并不能确认存在这个约束.. 有些情况下, 即使性能不好也只能这样使用. 宽泛的调优只能在不改变业务性质的情况下进行. 对业务本身进行优化是另外一个问题了.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 木匠</title>
		<link>http://www.anysql.net/dba/index_vs_table_filter.html/comment-page-1#comment-959</link>
		<dc:creator>木匠</dc:creator>
		<pubDate>Tue, 12 Jun 2007 11:03:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/or%e5%bc%95%e8%b5%b7%e7%9a%84%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98-%e5%9c%a8%e8%a1%a8%e4%b8%8a%e8%bf%9b%e8%a1%8c%e8%a1%8c%e8%bf%87%e6%bb%a4.html#comment-959</guid>
		<description>Eagle Fan, 谢谢你的深究, 我不够严谨, 知道却忘了写.
出于好奇, Eagle Fan 和 Eagle 是个啥关系?
你们都在eBay 或者 阿里 吗? (这个可能触犯隐私了, 哈哈)
</description>
		<content:encoded><![CDATA[<p>Eagle Fan, 谢谢你的深究, 我不够严谨, 知道却忘了写.<br />
出于好奇, Eagle Fan 和 Eagle 是个啥关系?<br />
你们都在eBay 或者 阿里 吗? (这个可能触犯隐私了, 哈哈)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eagle Fan</title>
		<link>http://www.anysql.net/dba/index_vs_table_filter.html/comment-page-1#comment-958</link>
		<dc:creator>Eagle Fan</dc:creator>
		<pubDate>Sat, 09 Jun 2007 18:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/or%e5%bc%95%e8%b5%b7%e7%9a%84%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98-%e5%9c%a8%e8%a1%a8%e4%b8%8a%e8%bf%9b%e8%a1%8c%e8%a1%8c%e8%bf%87%e6%bb%a4.html#comment-958</guid>
		<description>木匠：
composite index里面除非所有的列都为空才不存储改行，否则还是会存部分列的空值的
这其实感觉上像是oracle设计上的一个问题，如果你把select字段换为index中存在的，就会在index上做filter，如果select中有非index中的column，你要去touch表，那么oracle就会在表上去做filter，其实还是可以在index上做filter的
</description>
		<content:encoded><![CDATA[<p>木匠：<br />
composite index里面除非所有的列都为空才不存储改行，否则还是会存部分列的空值的<br />
这其实感觉上像是oracle设计上的一个问题，如果你把select字段换为index中存在的，就会在index上做filter，如果select中有非index中的column，你要去touch表，那么oracle就会在表上去做filter，其实还是可以在index上做filter的</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 木匠</title>
		<link>http://www.anysql.net/dba/index_vs_table_filter.html/comment-page-1#comment-957</link>
		<dc:creator>木匠</dc:creator>
		<pubDate>Thu, 07 Jun 2007 08:32:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.anysql.net/wordpress/uncategorized/or%e5%bc%95%e8%b5%b7%e7%9a%84%e6%80%a7%e8%83%bd%e9%97%ae%e9%a2%98-%e5%9c%a8%e8%a1%a8%e4%b8%8a%e8%bf%9b%e8%a1%8c%e8%a1%8c%e8%bf%87%e6%bb%a4.html#comment-957</guid>
		<description>这是什么鬼玩意儿, 仔细一想,又是合理的,
Index 里面不存 Null, 所以改成 非Null 值,
就可以用到 Index 存储值了.
我碰到一个更神奇的,
做表连接时, 因为链接列 有空值 Null,
Decode() 比 Nvl()快了约2倍,
两个表均有2百万条记录, 都采用了 Hash Join.
Here it is,
1) Decode()
select
t.LISTINGSID, s.CLIENTID, s.QUANTITY, s.PRICE, s.AUTHORNAME, s.TITLENAME, ...
from abelisting.list_part_src partition(v165046) s left outer join abelisting.list_part_target partition(v165046) t
on ( Nvl(s.VENDORLISTINGID,&#039; &#039;)=Nvl(t.VENDORLISTINGID,&#039; &#039;)
and decode(s.PUBLISHCITY, t.PUBLISHCITY,1,0) = 1
and decode(s.PUBLISHISO, t.PUBLISHISO,1,0) = 1
and Nvl(s.PUBLISHYEAR,0) = Nvl(t.PUBLISHYEAR,0)
and decode(s.PUBLISHERNAME, t.PUBLISHERNAME,1,0) = 1
and decode(s.AUTHORNAME, t.AUTHORNAME,1,0) = 1
and decode(s.TITLENAME, t.TITLENAME,1,0) = 1
and decode(s.DESCRIPTION, t.DESCRIPTION,1,0) = 1
);
2) Nvl()
select
t.LISTINGSID, s.CLIENTID, s.QUANTITY, s.PRICE, s.AUTHORNAME, s.TITLENAME, ...
from abelisting.list_part_src partition(v165046) s left outer join abelisting.list_part_target partition(v165046) t
on ( Nvl(s.VENDORLISTINGID,&#039; &#039;)=Nvl(t.VENDORLISTINGID,&#039; &#039;)
and Nvl(s.PUBLISHCITY,&#039; &#039;)=Nvl(t.PUBLISHCITY,&#039; &#039;)
and Nvl(s.PUBLISHISO ,&#039; &#039;)=Nvl(t.PUBLISHISO ,&#039; &#039;)
and Nvl(s.PUBLISHYEAR,  0)=Nvl(t.PUBLISHYEAR,  0)
and Nvl(s.PUBLISHERNAME,&#039; &#039;)=Nvl(t.PUBLISHERNAME,&#039; &#039;)
and Nvl(s.AUTHORNAME,&#039; &#039;) = Nvl(t.AUTHORNAME,&#039; &#039;)
and Nvl(s.TITLENAME,&#039; &#039;)=Nvl(t.TITLENAME,&#039; &#039;)
and Nvl(s.DESCRIPTION,&#039; &#039;)=Nvl(t.DESCRIPTION,&#039; &#039;) -- 80% more CPU time
);
</description>
		<content:encoded><![CDATA[<p>这是什么鬼玩意儿, 仔细一想,又是合理的,<br />
Index 里面不存 Null, 所以改成 非Null 值,<br />
就可以用到 Index 存储值了.<br />
我碰到一个更神奇的,<br />
做表连接时, 因为链接列 有空值 Null,<br />
Decode() 比 Nvl()快了约2倍,<br />
两个表均有2百万条记录, 都采用了 Hash Join.<br />
Here it is,<br />
1) Decode()<br />
select<br />
t.LISTINGSID, s.CLIENTID, s.QUANTITY, s.PRICE, s.AUTHORNAME, s.TITLENAME, &#8230;<br />
from abelisting.list_part_src partition(v165046) s left outer join abelisting.list_part_target partition(v165046) t<br />
on ( Nvl(s.VENDORLISTINGID,&#8217; &#8216;)=Nvl(t.VENDORLISTINGID,&#8217; &#8216;)<br />
and decode(s.PUBLISHCITY, t.PUBLISHCITY,1,0) = 1<br />
and decode(s.PUBLISHISO, t.PUBLISHISO,1,0) = 1<br />
and Nvl(s.PUBLISHYEAR,0) = Nvl(t.PUBLISHYEAR,0)<br />
and decode(s.PUBLISHERNAME, t.PUBLISHERNAME,1,0) = 1<br />
and decode(s.AUTHORNAME, t.AUTHORNAME,1,0) = 1<br />
and decode(s.TITLENAME, t.TITLENAME,1,0) = 1<br />
and decode(s.DESCRIPTION, t.DESCRIPTION,1,0) = 1<br />
);<br />
2) Nvl()<br />
select<br />
t.LISTINGSID, s.CLIENTID, s.QUANTITY, s.PRICE, s.AUTHORNAME, s.TITLENAME, &#8230;<br />
from abelisting.list_part_src partition(v165046) s left outer join abelisting.list_part_target partition(v165046) t<br />
on ( Nvl(s.VENDORLISTINGID,&#8217; &#8216;)=Nvl(t.VENDORLISTINGID,&#8217; &#8216;)<br />
and Nvl(s.PUBLISHCITY,&#8217; &#8216;)=Nvl(t.PUBLISHCITY,&#8217; &#8216;)<br />
and Nvl(s.PUBLISHISO ,&#8217; &#8216;)=Nvl(t.PUBLISHISO ,&#8217; &#8216;)<br />
and Nvl(s.PUBLISHYEAR,  0)=Nvl(t.PUBLISHYEAR,  0)<br />
and Nvl(s.PUBLISHERNAME,&#8217; &#8216;)=Nvl(t.PUBLISHERNAME,&#8217; &#8216;)<br />
and Nvl(s.AUTHORNAME,&#8217; &#8216;) = Nvl(t.AUTHORNAME,&#8217; &#8216;)<br />
and Nvl(s.TITLENAME,&#8217; &#8216;)=Nvl(t.TITLENAME,&#8217; &#8216;)<br />
and Nvl(s.DESCRIPTION,&#8217; &#8216;)=Nvl(t.DESCRIPTION,&#8217; &#8216;) &#8212; 80% more CPU time<br />
);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
