SQL> create table t

2  as

3  select rownum no, lpad(rownum, 10, '0') no2 from dual

4  connect by level <= 100000;

테이블이 생성되었습니다.

SQL>

SQL> set autotrace traceonly exp;

SQL>

SQL> select /*+ parallel(t) */ no, no2, rownum

2  from   t

3  order by no2;

Execution Plan

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

Plan hash value: 124124330

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

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

| Id  | Operation              | Name     | Rows  | Bytes |TempSpc| Cost (%CPU)|

Time     |    TQ  |IN-OUT| PQ Distrib |

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

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

|   0 | SELECT STATEMENT       |          |   122K|  2985K|       |    27  (23)|

00:00:01 |        |      |            |

|   1 |  SORT ORDER BY         |          |   122K|  2985K|  8680K|    27  (23)|

00:00:01 |        |      |            |

|   2 |   COUNT                |          |       |       |       |            |

|        |      |            |

|   3 |    PX COORDINATOR      |          |       |       |       |            |

|        |      |            |

|   4 |     PX SEND QC (RANDOM)| :TQ10000 |   122K|  2985K|       |    22   (5)|

00:00:01 |  Q1,00 | P->S | QC (RAND)  |

|   5 |      PX BLOCK ITERATOR |          |   122K|  2985K|       |    22   (5)|

00:00:01 |  Q1,00 | PCWC |            |

|   6 |       TABLE ACCESS FULL| T        |   122K|  2985K|       |    22   (5)|

00:00:01 |  Q1,00 | PCWP |            |

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

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

Note

-----

- dynamic sampling used for this statement

SQL>

SQL> set autotrace off;

SQL>

SQL> commit;

커밋이 완료되었습니다.

SQL>

SQL> alter session enable parallel dml;

세션이 변경되었습니다.

SQL>

SQL> explain plan for

2  update /*+ parallel(t 4) */ t set no2 = lpad(rownum, 5, '0');

해석되었습니다.

SQL>

SQL> --@?/rdbms/admin/utlxplp

SQL> set markup html preformat on

SQL> select * from table(dbms_xplan.display());

PLAN_TABLE_OUTPUT

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

Plan hash value: 1987214781

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

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

| Id  | Operation                         | Name     | Rows  | Bytes | Cost (%CP

U)| Time     |    TQ  |IN-OUT| PQ Distrib |

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

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

PLAN_TABLE_OUTPUT

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

|   0 | UPDATE STATEMENT                  |          |   122K|  1432K|    22   (

5)| 00:00:01 |        |      |            |

|   1 |  PX COORDINATOR                   |          |       |       |

|          |        |      |            |

|   2 |   PX SEND QC (RANDOM)             | :TQ20001 |   122K|  1432K|    22   (

5)| 00:00:01 |  Q2,01 | P->S | QC (RAND)  |

|   3 |    UPDATE                         | T        |       |       |

|          |  Q2,01 | PCWP |            |

PLAN_TABLE_OUTPUT

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

|   4 |     BUFFER SORT                   |          |       |       |

|          |  Q2,01 | PCWC |            |

|   5 |      PX RECEIVE                   |          |   122K|  1432K|    22   (

5)| 00:00:01 |  Q2,01 | PCWP |            |

|   6 |       PX SEND HASH (BLOCK ADDRESS)| :TQ20000 |   122K|  1432K|    22   (

5)| 00:00:01 |        | S->P | HASH (BLOCK|

|   7 |        COUNT                      |          |       |       |

PLAN_TABLE_OUTPUT

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

|          |        |      |            |

|   8 |         PX COORDINATOR            |          |       |       |

|          |        |      |            |

|   9 |          PX SEND QC (RANDOM)      | :TQ10000 |   122K|  1432K|    22   (

5)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |

|  10 |           PX BLOCK ITERATOR       |          |   122K|  1432K|    22   (

5)| 00:00:01 |  Q1,00 | PCWC |            |

PLAN_TABLE_OUTPUT

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

|  11 |            TABLE ACCESS FULL      | T        |   122K|  1432K|    22   (

5)| 00:00:01 |  Q1,00 | PCWP |            |

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

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

Note

-----

- dynamic sampling used for this statement

22 개의 행이 선택되었습니다.