【发布时间】:2010-12-02 16:53:30
【问题描述】:
我的问题类似于此线程中提出的问题: How to avoid this very heavy query that slows down the application?
我们检查了外键上缺失的索引并找到了一些。添加丢失的索引实际上会产生相反的效果,因为它会进一步减慢查询速度。一条重要信息是,我们的客户安装了一个 Oracle,我们的模式在其上复制了 21 次。每个模式中只有近 1,000 个表。我们是否对拥有如此大量表(当然还有索引)的 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服务器上,还是在应用服务器上?
-
我应该指定的。 Oracle 服务器是受到处理器影响的服务器。
标签: oracle hibernate performance