<?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>DBAlife &#187; like</title>
	<atom:link href="http://www.dbalife.com/archives/tag/like/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>网站系统架构实践</description>
	<lastBuildDate>Wed, 27 Jul 2011 09:57:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>模糊查询like &#039;%XX%&#039; 的优化一例</title>
		<link>http://www.dbalife.com/archives/176.html</link>
		<comments>http://www.dbalife.com/archives/176.html#comments</comments>
		<pubDate>Fri, 19 Sep 2008 06:47:33 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[DB性能优化]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[数据库管理]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/%e6%a8%a1%e7%b3%8a%e6%9f%a5%e8%af%a2like-xx-%e7%9a%84%e4%bc%98%e5%8c%96%e4%b8%80%e4%be%8b/</guid>
		<description><![CDATA[sql中的like '%xx%'模糊查询无法走索引，影响执行速度。经测试itpub版主ifree的index_ffs+rowid方法比较有效，记录一下。 这里是示例： scott@ORCL&#62; CREATE INDEX SCOTT.i_dept_name &#160;&#160;2&#160; &#160;ON SCOTT.DEPT(DNAME) &#160;&#160;3&#160;&#160;; Index created. scott@ORCL&#62; Analyze Table SCOTT.DEPT Compute Statistics ; Table analyzed. scott@ORCL&#62; select * from scott.dept where &#160;&#160;2&#160;&#160;rowid in ( &#160;&#160;3&#160;&#160;select /*+ index_ffs(a i_dept_dname) */ &#160;&#160;4&#160;&#160;rowid from scott.dept a where dname like '%A%') &#160;&#160;5&#160;&#160;; 这个方法要求like查询出的记录不能太多，在我的应用中，这一方法使sql效率提高了近10倍。 Blogged with the Flock Browser Tags: sql, 优化, turning, [...]
Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/33.html' rel='bookmark' title='Oracle9i优化器介绍（上）'>Oracle9i优化器介绍（上）</a></li>
<li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>sql中的like '%xx%'模糊查询无法走索引，影响执行速度。经测试itpub版主ifree的index_ffs+rowid方法比较有效，记录一下。</p>
<p>这里是示例：</p>
<div style="margin-left: 40px;"> scott@ORCL&gt; CREATE INDEX SCOTT.i_dept_name<br />
&nbsp;&nbsp;2&nbsp; &nbsp;ON SCOTT.DEPT(DNAME)<br />
&nbsp;&nbsp;3&nbsp;&nbsp;;</p>
<p>Index created.</p>
<p>scott@ORCL&gt; Analyze Table SCOTT.DEPT Compute Statistics ;</p>
<p>Table analyzed.</p>
<p>scott@ORCL&gt; select * from scott.dept where<br />
&nbsp;&nbsp;2&nbsp;&nbsp;rowid in (<br />
&nbsp;&nbsp;3&nbsp;&nbsp;select /*+ index_ffs(a i_dept_dname) */<br />
&nbsp;&nbsp;4&nbsp;&nbsp;rowid from scott.dept a where dname like '%A%')<br />
&nbsp;&nbsp;5&nbsp;&nbsp;;</p>
</div>
<p>这个方法要求like查询出的记录不能太多，在我的应用中，这一方法使sql效率提高了近10倍。</p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/sql" rel="tag">sql</a>, <a href="http://technorati.com/tag/%E4%BC%98%E5%8C%96" rel="tag">优化</a>, <a href="http://technorati.com/tag/turning" rel="tag">turning</a>, <a href="http://technorati.com/tag/like" rel="tag">like</a>, <a href="http://technorati.com/tag/%E6%A8%A1%E7%B3%8A%E6%9F%A5%E8%AF%A2" rel="tag">模糊查询</a></p>
<p><!-- technorati tags end --></p>
<p>Related posts:<ol>
<li><a href='http://www.dbalife.com/archives/33.html' rel='bookmark' title='Oracle9i优化器介绍（上）'>Oracle9i优化器介绍（上）</a></li>
<li><a href='http://www.dbalife.com/archives/286.html' rel='bookmark' title='oralce10g shrink'>oralce10g shrink</a></li>
<li><a href='http://www.dbalife.com/archives/32.html' rel='bookmark' title='Oracle9i优化器介绍（下）'>Oracle9i优化器介绍（下）</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/176.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

