oracle中的高水位(HWM)

oracle中的高水位(HWM)
找一个记录数较多的表,100万条以上的,如表test1。
create table test2 as select * from test1 where 1=2;
insert into test2 select * from test1;

commit;

delete from test2;

commit;
此时执行select * from test2;虽然test2中没有任何记录但需要很长时间。
解决办法:
方法1:truncate table test2;
方法2:
    alter table test2 enable row movement;
    alter table test2 shrink space;
再执行select * from test2;应该在0.1秒以内。

你可能感兴趣的:(oracle,session,table,insert)