<?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: connect by的性能分析</title>
	<atom:link href="http://www.os2ora.com/connect-by-performance-tunning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.os2ora.com/connect-by-performance-tunning/</link>
	<description>专注于现实世界Oracle数据库的高性能，高可扩展性与新一代数据库Exadata架构</description>
	<lastBuildDate>Fri, 20 Aug 2010 08:28:04 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Validba&#39;S Home &#187; 求两个时间点之间的时间序列问题</title>
		<link>http://www.os2ora.com/connect-by-performance-tunning/comment-page-1/#comment-678</link>
		<dc:creator>Validba&#39;S Home &#187; 求两个时间点之间的时间序列问题</dc:creator>
		<pubDate>Fri, 23 Jul 2010 09:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.os2ora.com/connect-by-performance-tunning/#comment-678</guid>
		<description>[...] 最后从http://www.os2ora.com/how-to-return-continuous-dates-between-two-dates/发现一个同样的案例,OS2提供了一个非常不错的方法：关于connect by的性能分析详见http://www.os2ora.com/connect-by-performance-tunning/ [...]</description>
		<content:encoded><![CDATA[<p>[...] 最后从http://www.os2ora.com/how-to-return-continuous-dates-between-two-dates/发现一个同样的案例,OS2提供了一个非常不错的方法：关于connect by的性能分析详见http://www.os2ora.com/connect-by-performance-tunning/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robinma</title>
		<link>http://www.os2ora.com/connect-by-performance-tunning/comment-page-1/#comment-666</link>
		<dc:creator>robinma</dc:creator>
		<pubDate>Fri, 16 Jul 2010 09:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.os2ora.com/connect-by-performance-tunning/#comment-666</guid>
		<description>好文章</description>
		<content:encoded><![CDATA[<p>好文章</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.os2ora.com/connect-by-performance-tunning/comment-page-1/#comment-11</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 18 Apr 2009 09:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.os2ora.com/connect-by-performance-tunning/#comment-11</guid>
		<description>嗯，一般情况下，碰到这种问题时，很多人可能有类似的想法，就是用dual来实现。例如为了实现生成一个连续的整数列表，如1,2,3...100，可以简单的：
&lt;pre lang=&quot;sql&quot; line=&quot;1&quot;&gt; 
select level from dual connect by level&lt;100;
&lt;/pre&gt;

这里当然可以用这种思路，加上一个with 子句就得到了你提到的这种写法。

不过性能我觉得是不相上下的，你说的性能比前两个好不知是基于什么标准？执行时间？执行计划？

从执行计划看，我其实还是更倾向于我原来的第二种写法:

&lt;pre lang=&quot;sql&quot; line=&quot;1&quot;&gt;
SQL&gt; set autot trace exp
SQL&gt; SELECT begin_date + level - 1 one_date
  2  FROM (SELECT min(begin_date) begin_date, max(end_date) end_date
  3  FROM test) test
  4  connect BY begin_date + level - 1 &lt; = end_date
  5  ;
Elapsed: 00:00:00.00

Execution Plan
----------------------------------------------------------
Plan hash value: 928680046

-------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                    &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
-------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT             &#124;      &#124;     1 &#124;    18 &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;*  1 &#124;  CONNECT BY WITHOUT FILTERING&#124;      &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   2 &#124;   VIEW                       &#124;      &#124;     1 &#124;    18 &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;   3 &#124;    SORT AGGREGATE            &#124;      &#124;     1 &#124;    18 &#124;            &#124;          &#124;
&#124;   4 &#124;     TABLE ACCESS STORAGE FULL&#124; TEST &#124;     2 &#124;    36 &#124;     3   (0)&#124; 00:00:01 &#124;
-------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;END_DATE&quot;&gt;=INTERNAL_FUNCTION(&quot;BEGIN_DATE&quot;)+LEVEL-1)

Note
-----
   - dynamic sampling used for this statement

SQL&gt; with abc as
  2  (SELECT /*+ materialize */ max(end_date) ed,min(begin_date) bd ,max(end_date)-min(begin_date) days FROM test)
  3  select (select bd from abc)+level from dual connect by level&lt;(select days from abc);
Elapsed: 00:00:00.00

Execution Plan
----------------------------------------------------------
Plan hash value: 2352707181

-------------------------------------------------------------------------------------------------------------
&#124; Id  &#124; Operation                     &#124; Name                        &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
-------------------------------------------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT              &#124;                             &#124;     1 &#124;       &#124;     5   (0)&#124; 00:00:01 &#124;
&#124;   1 &#124;  VIEW                         &#124;                             &#124;     1 &#124;     9 &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;   2 &#124;   TABLE ACCESS FULL           &#124; SYS_TEMP_0FD9D6602_21C39D13 &#124;     1 &#124;    18 &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;   3 &#124;  TEMP TABLE TRANSFORMATION    &#124;                             &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   4 &#124;   LOAD AS SELECT              &#124; DUAL                        &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   5 &#124;    SORT AGGREGATE             &#124;                             &#124;     1 &#124;    18 &#124;            &#124;          &#124;
&#124;   6 &#124;     TABLE ACCESS STORAGE FULL &#124; TEST                        &#124;     2 &#124;    36 &#124;     3   (0)&#124; 00:00:01 &#124;
&#124;*  7 &#124;   CONNECT BY WITHOUT FILTERING&#124;                             &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   8 &#124;    FAST DUAL                  &#124;                             &#124;     1 &#124;       &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;   9 &#124;    VIEW                       &#124;                             &#124;     1 &#124;     6 &#124;     2   (0)&#124; 00:00:01 &#124;
&#124;  10 &#124;     TABLE ACCESS FULL         &#124; SYS_TEMP_0FD9D6602_21C39D13 &#124;     1 &#124;    18 &#124;     2   (0)&#124; 00:00:01 &#124;
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - filter(LEVEL&lt; (SELECT &quot;DAYS&quot; FROM  (SELECT /*+ CACHE_TEMP_TABLE (&quot;T1&quot;) */ &quot;C0&quot; &quot;ED&quot;,&quot;C1&quot;
              &quot;BD&quot;,INTERNAL_FUNCTION(&quot;C2&quot;) &quot;DAYS&quot; FROM &quot;SYS&quot;.&quot;SYS_TEMP_0FD9D6602_21C39D13&quot; &quot;T1&quot;) &quot;ABC&quot;))

Note
-----
   - dynamic sampling used for this statement

SQL&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>嗯，一般情况下，碰到这种问题时，很多人可能有类似的想法，就是用dual来实现。例如为了实现生成一个连续的整数列表，如1,2,3&#8230;100，可以简单的：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> level <span style="color: #993333; font-weight: bold;">FROM</span> dual connect <span style="color: #993333; font-weight: bold;">BY</span> level<span style="color: #66cc66;">&lt;</span><span style="color: #cc66cc;">100</span>;</pre></td></tr></table></div>

<p>这里当然可以用这种思路，加上一个with 子句就得到了你提到的这种写法。</p>
<p>不过性能我觉得是不相上下的，你说的性能比前两个好不知是基于什么标准？执行时间？执行计划？</p>
<p>从执行计划看，我其实还是更倾向于我原来的第二种写法:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> autot trace exp
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> begin_date <span style="color: #66cc66;">+</span> level <span style="color: #66cc66;">-</span> <span style="color: #cc66cc;">1</span> one_date
  <span style="color: #cc66cc;">2</span>  <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> min<span style="color: #66cc66;">&#40;</span>begin_date<span style="color: #66cc66;">&#41;</span> begin_date<span style="color: #66cc66;">,</span> max<span style="color: #66cc66;">&#40;</span>end_date<span style="color: #66cc66;">&#41;</span> end_date
  <span style="color: #cc66cc;">3</span>  <span style="color: #993333; font-weight: bold;">FROM</span> test<span style="color: #66cc66;">&#41;</span> test
  <span style="color: #cc66cc;">4</span>  connect <span style="color: #993333; font-weight: bold;">BY</span> begin_date <span style="color: #66cc66;">+</span> level <span style="color: #66cc66;">-</span> <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #66cc66;">=</span> end_date
  <span style="color: #cc66cc;">5</span>  ;
Elapsed: 00:00:<span style="color: #cc66cc;">00.00</span>
&nbsp;
Execution Plan
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
Plan hash value: <span style="color: #cc66cc;">928680046</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                    <span style="color: #66cc66;">|</span> Name <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT             <span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">3</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  CONNECT <span style="color: #993333; font-weight: bold;">BY</span> WITHOUT FILTERING<span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">VIEW</span>                       <span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">3</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">|</span>    SORT AGGREGATE            <span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">|</span>     <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS STORAGE <span style="color: #993333; font-weight: bold;">FULL</span><span style="color: #66cc66;">|</span> TEST <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">36</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">3</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">-</span> filter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;END_DATE&quot;</span><span style="color: #66cc66;">&gt;=</span>INTERNAL_FUNCTION<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;BEGIN_DATE&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span>LEVEL<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
Note
<span style="color: #808080; font-style: italic;">-----</span>
   <span style="color: #66cc66;">-</span> dynamic sampling used <span style="color: #993333; font-weight: bold;">FOR</span> this statement
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">WITH</span> abc <span style="color: #993333; font-weight: bold;">AS</span>
  <span style="color: #cc66cc;">2</span>  <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/*+ materialize */</span> max<span style="color: #66cc66;">&#40;</span>end_date<span style="color: #66cc66;">&#41;</span> ed<span style="color: #66cc66;">,</span>min<span style="color: #66cc66;">&#40;</span>begin_date<span style="color: #66cc66;">&#41;</span> bd <span style="color: #66cc66;">,</span>max<span style="color: #66cc66;">&#40;</span>end_date<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>min<span style="color: #66cc66;">&#40;</span>begin_date<span style="color: #66cc66;">&#41;</span> days <span style="color: #993333; font-weight: bold;">FROM</span> test<span style="color: #66cc66;">&#41;</span>
  <span style="color: #cc66cc;">3</span>  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> bd <span style="color: #993333; font-weight: bold;">FROM</span> abc<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span>level <span style="color: #993333; font-weight: bold;">FROM</span> dual connect <span style="color: #993333; font-weight: bold;">BY</span> level<span style="color: #66cc66;">&lt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> days <span style="color: #993333; font-weight: bold;">FROM</span> abc<span style="color: #66cc66;">&#41;</span>;
Elapsed: 00:00:<span style="color: #cc66cc;">00.00</span>
&nbsp;
Execution Plan
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
Plan hash value: <span style="color: #cc66cc;">2352707181</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                     <span style="color: #66cc66;">|</span> Name                        <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT              <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">5</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">VIEW</span>                         <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">9</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">FULL</span>           <span style="color: #66cc66;">|</span> SYS_TEMP_0FD9D6602_21C39D13 <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">|</span>  TEMP <span style="color: #993333; font-weight: bold;">TABLE</span> TRANSFORMATION    <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">LOAD</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">SELECT</span>              <span style="color: #66cc66;">|</span> DUAL                        <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">|</span>    SORT AGGREGATE             <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">6</span> <span style="color: #66cc66;">|</span>     <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS STORAGE <span style="color: #993333; font-weight: bold;">FULL</span> <span style="color: #66cc66;">|</span> TEST                        <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">36</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">3</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">7</span> <span style="color: #66cc66;">|</span>   CONNECT <span style="color: #993333; font-weight: bold;">BY</span> WITHOUT FILTERING<span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>            <span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">8</span> <span style="color: #66cc66;">|</span>    FAST DUAL                  <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">9</span> <span style="color: #66cc66;">|</span>    <span style="color: #993333; font-weight: bold;">VIEW</span>                       <span style="color: #66cc66;">|</span>                             <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">6</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">|</span>     <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">FULL</span>         <span style="color: #66cc66;">|</span> SYS_TEMP_0FD9D6602_21C39D13 <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">18</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">7</span> <span style="color: #66cc66;">-</span> filter<span style="color: #66cc66;">&#40;</span>LEVEL<span style="color: #66cc66;">&lt;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">&quot;DAYS&quot;</span> <span style="color: #993333; font-weight: bold;">FROM</span>  <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/*+ CACHE_TEMP_TABLE (&quot;T1&quot;) */</span> <span style="color: #ff0000;">&quot;C0&quot;</span> <span style="color: #ff0000;">&quot;ED&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;C1&quot;</span>
              <span style="color: #ff0000;">&quot;BD&quot;</span><span style="color: #66cc66;">,</span>INTERNAL_FUNCTION<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;C2&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;DAYS&quot;</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">&quot;SYS&quot;</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">&quot;SYS_TEMP_0FD9D6602_21C39D13&quot;</span> <span style="color: #ff0000;">&quot;T1&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;ABC&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
Note
<span style="color: #808080; font-style: italic;">-----</span>
   <span style="color: #66cc66;">-</span> dynamic sampling used <span style="color: #993333; font-weight: bold;">FOR</span> this statement
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: zhang yong hui</title>
		<link>http://www.os2ora.com/connect-by-performance-tunning/comment-page-1/#comment-10</link>
		<dc:creator>zhang yong hui</dc:creator>
		<pubDate>Fri, 17 Apr 2009 09:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.os2ora.com/connect-by-performance-tunning/#comment-10</guid>
		<description>你好， 看了你这篇文章很有启发， 我想出了另一种sql的写法：
with abc as
(SELECT /*+ materialize */ max(end_date) ed,min(begin_date) bd ,max(end_date)-min(begin_date) days  FROM test)
select (select bd from abc)+level from dual connect by  level&lt;(select days from abc);

经过测试， 这个sql的性能比前两个都要好。</description>
		<content:encoded><![CDATA[<p>你好， 看了你这篇文章很有启发， 我想出了另一种sql的写法：<br />
with abc as<br />
(SELECT /*+ materialize */ max(end_date) ed,min(begin_date) bd ,max(end_date)-min(begin_date) days  FROM test)<br />
select (select bd from abc)+level from dual connect by  level&lt;(select days from abc);</p>
<p>经过测试， 这个sql的性能比前两个都要好。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yefeng</title>
		<link>http://www.os2ora.com/connect-by-performance-tunning/comment-page-1/#comment-2</link>
		<dc:creator>Yefeng</dc:creator>
		<pubDate>Mon, 23 Mar 2009 13:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.os2ora.com/connect-by-performance-tunning/#comment-2</guid>
		<description>谢谢，受教了</description>
		<content:encoded><![CDATA[<p>谢谢，受教了</p>
]]></content:encoded>
	</item>
</channel>
</rss>
