查詢出資料庫中預設會以全表掃描方式訪問的表
/*Auth:chensq#itpub.net
Date:2005-07-29 17:43
*/
select segment_name,bytes from dba_segments a,dba_tables b
where bytescase when (select 0 from dual where not exists (select value from v$parameter where name like '%small_table_%'))=0 then
--parameter _small_table_threshold is not seted
(select case when (select SUBSTR(BANNER,6,1) from v$version where banner like 'CORE%')<9 then --lower than 9i
(select value*.02 from v$parameter where name='db_cache_size')
else (bytes/a.blocks)*20--above 9i
end from dual)
else
(select to_number(value) from v$parameter where name like '%small_table_%')
end
)--_small_table_threshold
and a.segment_name=b.table_name
這個查詢可以根據初始化引數設定和軟體版本,查詢出預設情況下會以全表掃描方式訪問的表。
理論依據可以參見網上的一些文章(搜尋_small_table_threshold)或者《Oracle 9i效能調整》第496~497頁。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21072/viewspace-815377/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE全表掃描查詢Oracle
- 查詢全表掃描的sqlSQL
- 查詢全表掃描語句
- Oracle中存取資料掃描Table及索引的方式(全表掃描,索引掃描等)Oracle索引
- 執行計劃-資料訪問方式(全表掃描與4種索引的方式)索引
- MySQL中的全表掃描和索引樹掃描MySql索引
- 24_Oracle資料庫全表掃描詳解(四)_全表掃描生產最佳化案例三則Oracle資料庫
- 23_Oracle資料庫全表掃描詳解(三)Oracle資料庫
- 22_Oracle資料庫全表掃描詳解(二)Oracle資料庫
- 21_Oracle資料庫全表掃描詳解(一)Oracle資料庫
- 關係型資料庫全表掃描分片詳解資料庫
- 優化Oracle with全表掃描的問題優化Oracle
- 關於分割槽表中的全partition掃描問題
- Oracle 11g全表掃描以Direct Path Read方式執行Oracle
- 優化全表掃描優化
- delete 與全表掃描delete
- 資料庫中單表查詢資料庫
- delete 刪除資料 全表掃描還是掃描所有塊的測試delete
- 優化Oracle with全表掃描的問題(二)優化Oracle
- 使用全表掃描快取大表的相關問題快取
- 資料庫全表查詢之-分頁查詢優化資料庫優化
- 【SQL】查詢及修改資料庫預設表空間SQL資料庫
- 抓取全表掃描的表,篩選和分析
- zt:東軟醫保動態庫全表掃描問題
- oracle 全表掃描,索引範圍掃描與塊的理解Oracle索引
- 使用索引快速全掃描(Index FFS)避免全表掃描的若干場景索引Index
- 全表掃描的cost 與 索引掃描Cost的比較 – 無直方圖(10.1.0.3以後)索引直方圖
- oracle優化:避免全表掃描Oracle優化
- oracle是如何進行全表掃描的Oracle
- MySQL查詢資料庫中沒有主鍵的表MySql資料庫
- 資料庫基礎查詢--單表查詢資料庫
- 【資料庫】sql連表查詢資料庫SQL
- 查詢資料庫表是否存在資料庫
- (轉)索引掃描還是全表掃描(Index Scan Or Full Table Scan)索引Index
- 轉)索引掃描還是全表掃描(Index Scan Or Full Table Scan)索引Index
- 一條全表掃描sql語句的分析SQL
- 【TABLESPACE】Oracle資料庫預設永久表空間的查詢及刪除方法Oracle資料庫
- 查詢MySQL資料庫,MySQL表的大小MySql資料庫