사용자 도구

사이트 도구


dbms:oracle:devel:group

그냥 참조용.

SQL> select department_id from employees;

DEPARTMENT_ID


         90
         90
         90
         60
         60
         60
         50
         50
         50
         50
         50
         80
         80
         80
         10
         20
         20
        110
        110

20 rows selected.

Execution Plan


Plan hash value: 1445457117


Id Operation Name Rows Bytes Cost (%CPU) Time

——————————————————————————-

0 SELECT STATEMENT 20 60 3 (0) 00:00:01
1 TABLE ACCESS FULL EMPLOYEES 20 60 3 (0) 00:00:01

——————————————————————————-

SQL> ed Wrote file afiedt.buf

1  select department_id from employees
2* group by department_id

SQL> /

DEPARTMENT_ID


         90
         20
        110
         50
         80
         60
         10

8 rows selected.

Execution Plan


Plan hash value: 1192169904


Id Operation Name Rows Bytes Cost (%CPU) Time

——————————————————————————–

0 SELECT STATEMENT 7 21 4 (25) 00:00:01
1 HASH GROUP BY 7 21 4 (25) 00:00:01
2 TABLE ACCESS FULL EMPLOYEES 20 60 3 (0) 00:00:01

——————————————————————————–

SQL> select distinct department_id from employees;

DEPARTMENT_ID


         90
         20
        110
         50
         80
         60
         10

8 rows selected.

Execution Plan


Plan hash value: 3042654289


Id Operation Name Rows Bytes Cost (%CPU) Time

——————————————————————————–

0 SELECT STATEMENT 7 21 4 (25) 00:00:01
1 HASH UNIQUE 7 21 4 (25) 00:00:01
2 TABLE ACCESS FULL EMPLOYEES 20 60 3 (0) 00:00:01

——————————————————————————–

dbms/oracle/devel/group.txt · 마지막으로 수정됨: 2010/01/31 00:17 저자 upju