文档课题:oracle查索引大小.标签:00,random,大小,dbms,Elapsed,索引,emp,SQL,oracle From: https://blog.51cto.com/u_12991611/5815047
数据库:oracle 11.2.0.4 64位
以下为实际操作过程.
SQL> create table emp_init(
2 id number(12),
3 name varchar2(20),
4 age number(3),
5 salary number(6),
6 create_time timestamp default sysdate,
7 remark nvarchar2(100),
8 primary key(id));
Table created.
Elapsed: 00:00:00.07
SQL> insert into emp_init
2 select rownum,
3 dbms_random.string('*', dbms_random.value(6, 20)),
4 dbms_random.value(18, 65),
5 dbms_random.value(1000, 50000),
6 sysdate,
7 dbms_random.string('*', dbms_random.value(10, 100))
8 from dual
9 connect by level < 4001;
4000 rows created.
Elapsed: 00:00:00.83
SQL> commit;
Commit complete.
Elapsed: 00:00:00.00
SQL> create index ind_emp_init_date on emp_init (create_time);
Index created.
Elapsed: 00:00:00.01
SQL> select blocks,bytes from dba_segments where owner='SYS' and segment_name='IND_EMP_INIT_DATE';
BLOCKS BYTES
---------- ----------
16 131072
SQL> select blocks,bytes from dba_segments where owner='SYS' and segment_name='EMP_INIT';
BLOCKS BYTES
---------- ----------
88 720896