我的問題是類似的,在這個線程的一個構成: How to avoid this very heavy query that slows down the application?Hibernate的索引查詢慢
我們檢查丟失外鍵索引和發現了一些。添加缺失的索引實際上具有相反的效果,因爲它會進一步減慢查詢速度。一條重要信息是我們的客戶有一次Oracle安裝,其中我們的模式複製了21次。每個模式只有1000個表格。我們是否要求太多的Oracle擁有如此大量的表格(當然還有索引)?我不知道他們的硬件是什麼,但我的問題是這是一種合理的方法,還是將用戶分解爲不同的SID會更好?
以下是Hibernate正在執行的查詢。客戶告訴我們,這個查詢在執行時佔用了處理器的45%左右(儘管我不知道該處理多長時間)。
任何建議表示讚賞, 史蒂夫
SELECT NULL AS table_cat,
owner AS table_schem,
table_name,
0 AS non_unique,
NULL AS index_qualifier,
NULL AS index_name,
0 AS TYPE,
0 AS ordinal_position,
NULL AS column_name,
NULL AS asc_or_desc,
num_rows AS CARDINALITY,
blocks AS pages,
NULL AS filter_condition
FROM all_tables
WHERE table_name = 'BOOKING'
AND owner = 'FORWARD_TN'
UNION
SELECT NULL AS table_cat,
i.owner AS table_schem,
i.table_name,
DECODE (i.uniqueness, 'UNIQUE', 0, 1),
NULL AS index_qualifier,
i.index_name,
1 AS TYPE,
c.column_position AS ordinal_position,
c.column_name,
NULL AS asc_or_desc,
i.distinct_keys AS CARDINALITY,
i.leaf_blocks AS pages,
NULL AS filter_condition
FROM all_indexes i,
all_ind_columns c
WHERE i.table_name = 'BOOKING'
AND i.owner = 'FORWARD_TN'
AND i.index_name = c.index_name
AND i.table_owner = c.table_owner
AND i.table_name = c.table_name
AND i.owner = c.index_owner
ORDER BY non_unique,
TYPE,
index_name,
ordinal_position
處理器在oracle服務器上,還是在應用服務器上? – skaffman 2010-12-02 16:54:38
我應該指定。 Oracle服務器是處理器命中的人。 – 2010-12-02 17:54:39