13.05.2013 Views

Thanks for the question regarding "connect by ", versi

Thanks for the question regarding "connect by ", versi

Thanks for the question regarding "connect by ", versi

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 - filter("COL2"=2)<br />

Note<br />

-----<br />

- dynamic sampling used <strong>for</strong> this statement<br />

gregs-ORA10 > create index junk_ind1 on junk ( col2 )<br />

2 /<br />

Index created.<br />

gregs-ORA10 > select col1<br />

2 from junk<br />

3 start with col2 = 2<br />

4 <strong>connect</strong> <strong>by</strong> prior col1 = col2<br />

5 /<br />

Execution Plan<br />

----------------------------------------------------------<br />

Plan hash value: 3206560888<br />

-------------------------------------------------------------------------------------------<br />

| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |<br />

-------------------------------------------------------------------------------------------<br />

| 0 | SELECT STATEMENT | | 1 | 26 | 1 (0)| 00:00:01 |<br />

|* 1 | CONNECT BY WITH FILTERING | | | | | |<br />

| 2 | TABLE ACCESS BY INDEX ROWID | JUNK | 1 | 52 | 1 (0)| 00:00:01 |<br />

|* 3 | INDEX RANGE SCAN | JUNK_IND1 | 1 | | 1 (0)| 00:00:01 |<br />

| 4 | NESTED LOOPS | | | | | |<br />

| 5 | BUFFER SORT | | | | | |<br />

| 6 | CONNECT BY PUMP | | | | | |<br />

| 7 | TABLE ACCESS BY INDEX ROWID| JUNK | 1 | 26 | 1 (0)| 00:00:01 |<br />

|* 8 | INDEX RANGE SCAN | JUNK_IND1 | 1 | | 1 (0)| 00:00:01 |<br />

| 9 | TABLE ACCESS FULL | JUNK | 8 | 312 | 2 (0)| 00:00:01 |<br />

-------------------------------------------------------------------------------------------<br />

Predicate In<strong>for</strong>mation (identified <strong>by</strong> operation id):<br />

---------------------------------------------------<br />

1 - access("COL2"=PRIOR "COL1")<br />

3 - access("COL2"=2)<br />

8 - access("COL2"=PRIOR "COL1")<br />

Note<br />

-----<br />

- dynamic sampling used <strong>for</strong> this statement<br />

gregs-ORA10 > analyze table junk compute statistics;<br />

Table analyzed.<br />

gregs-ORA10 > select col1<br />

2 from junk<br />

3 start with col2 = 2<br />

4 <strong>connect</strong> <strong>by</strong> prior col1 = col2<br />

5 /<br />

Execution Plan<br />

----------------------------------------------------------<br />

Plan hash value: 3206560888<br />

-------------------------------------------------------------------------------------------<br />

| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |<br />

-------------------------------------------------------------------------------------------<br />

| 0 | SELECT STATEMENT | | 2 | 6 | 1 (0)| 00:00:01 |<br />

|* 1 | CONNECT BY WITH FILTERING | | | | | |<br />

| 2 | TABLE ACCESS BY INDEX ROWID | JUNK | 1 | 6 | 1 (0)| 00:00:01 |<br />

|* 3 | INDEX RANGE SCAN | JUNK_IND1 | 1 | | 1 (0)| 00:00:01 |<br />

| 4 | NESTED LOOPS | | | | | |<br />

| 5 | BUFFER SORT | | | | | |<br />

| 6 | CONNECT BY PUMP | | | | | |<br />

| 7 | TABLE ACCESS BY INDEX ROWID| JUNK | 2 | 6 | 1 (0)| 00:00:01 |<br />

|* 8 | INDEX RANGE SCAN | JUNK_IND1 | 1 | | 1 (0)| 00:00:01 |<br />

| 9 | TABLE ACCESS FULL | JUNK | 8 | 40 | 2 (0)| 00:00:01 |<br />

-------------------------------------------------------------------------------------------<br />

Predicate In<strong>for</strong>mation (identified <strong>by</strong> operation id):<br />

---------------------------------------------------

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!