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
|
Connected to Oracle9i Enterprise Edition Release 9.2.0.5.0
Connected as mni
SQL>
SQL> drop table emp_3
2 /
Table dropped
SQL>
SQL> create table emp_3 as
2 select 'ORACLE' company, empno, ename, job, mgr, hiredate, sal, comm, deptno
3 From emp
4 /
Table created
SQL> alter table emp_3
2 add constraint pk_emp_3 primary key (company, empno)
3 /
Table altered
SQL> alter index pk_emp_3 rebuild reverse
2 /
Index altered
SQL> exec dbms_stats.gather_table_stats(USER, 'EMP_3', cascade => True)
PL/SQL procedure successfully completed
SQL> set autotrace traceonly explain
SQL> Select *
from emp_3
where company = 'ORACLE'
2 3 4 /
Plan d'exécution
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=FIRST_ROWS (Cost=2 Card=14 Bytes=
616)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'EMP_3' (Cost=2 Card=14 B
ytes=616)
2 1 INDEX (RANGE SCAN) OF 'PK_EMP_3' (UNIQUE) (Cost=1 Card=1
4) |
Partager