char(1)并且not null是最省空间的。可以做这样的测试:
create table t_test1(
col3 char(1) not null,
col4 char(1) not null,
col5 char(1) not null,
col6 char(1) not null,
col7 char(1) not null,
col8 char(1) not null,
col9 char(1) not null
)
/
create table t_test2(
col3 number(1) not null,
col4 number(1) not null,
col5 number(1) not null,
col6 number(1) not null,
col7 number(1) not null,
col8 number(1) not null,
col9 number(1) not null
)
/
insert into t_test1 select '1','1','1','1','1','1','1' from all_tab_columns order by table_name,column_id;
insert into t_test2 select 1,1,1,1,1,1,1 from all_tab_columns order by table_name,column_id;
commit;
insert into t_test1 select * from t_test1;
insert into t_test1 select * from t_test1;
commit;
insert into t_test2 select * from t_test2;
insert into t_test2 select * from t_test2;
commit;
analyze table t_test1 compute statistics;
analyze table t_test2 compute statistics;
select segment_name,bytes from user_segments where segment_name like 'T_TEST%';
select table_name,NUM_ROWS,BLOCKS,AVG_ROW_LEN from user_tables where table_name like 'T_TEST%';