Buffer Sort

BUFFER (SORT)
Description
Performs a memory sort on a row source 




CREATE TABLE t1 (c01 NUMBER);  
CREATE INDEX T1_C1 ON T1(C01);

CREATE TABLE t2 (c02 NUMBER); 

BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname          => 'SCOTT',
                                tabname          => 'T1',
                                estimate_percent => 30,
                                method_opt       => 'for all columns size repeat',
                                no_invalidate    => FALSE,
                                degree           => 8,
                                cascade          => TRUE);
END;

BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname          => 'SCOTT',
                                tabname          => 'T2',
                                estimate_percent => 30,
                                method_opt       => 'for all columns size repeat',
                                no_invalidate    => FALSE,
                                degree           => 8,
                                cascade          => TRUE);
END;

SQL> set autot trace
SQL> SELECT t1.c01, t2.c02  FROM t1,t2;

Execution Plan
----------------------------------------------------------
Plan hash value: 787647388

-----------------------------------------------------------------------------
| Id  | Operation	     | Name | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |	    |	  1 |	 26 |	  4   (0)| 00:00:01 |
|   1 |  MERGE JOIN CARTESIAN|	    |	  1 |	 26 |	  4   (0)| 00:00:01 |
|   2 |   TABLE ACCESS FULL  | T1   |	  1 |	 13 |	  2   (0)| 00:00:01 |
|   3 |   BUFFER SORT	     |	    |	  1 |	 13 |	  2   (0)| 00:00:01 |
|   4 |    TABLE ACCESS FULL | T2   |	  1 |	 13 |	  2   (0)| 00:00:01 |
-----------------------------------------------------------------------------

你可能感兴趣的:(Buffer Sort)