--在Oacle資料庫涉及到全表掃描的SQL查詢(top,count)中,
--現場使用者刪除表中大部分資料,只保留1W條資料,但是查詢仍然很慢,檢查磁碟IO,發現磁碟IO不是很高
--經過分析Oacle資料庫的表被撐大後,雖然刪除了資料,但是資料塊仍然被該表佔用,全表掃描時,
--這些資料塊都會被遍歷,導致查詢效能很慢。 --查詢資料塊SQL語句如下
select * from dba_segments where segment_name in ('table_name_1'); --解決方案
--對Oacle資料庫表進行收縮操作
--SQL語句如下
alter table table_name_1 enable row movement ;
alter table table_name_1 enable shrink space ;