Oracle count(*) 耗时长解决实况

2014-11-24 18:15:01 · 作者: · 浏览: 0

1. 环境: 表记录900w条;


2. 使用:count(*), count(rowid), count(主键) 都需要30多秒


3. 使用语句查看FSFI:


select tablespace_name,sqrt(max(blocks)/sum(blocks))* (100/sqrt(sqrt(count(blocks)))) FSFI


from dba_free_space


group by tablespace_name order by 1;