ITPub博客

首页 > IT基础架构 > 网络安全 > Use of Indexes Against Views (179)

Use of Indexes Against Views (179)

原创 网络安全 作者:tsinglee 时间:2007-11-11 19:55:53 0 删除 编辑

Oracle determines whether to use indexes for a query against a view by transforming
the original query when merging it with the view’s defining query.

In all possible cases, Oracle merges a query against a view with the view’s defining
query and those of any underlying views. Oracle optimizes the merged query as if you
issued the query without referencing the views. Therefore, Oracle can use indexes on
any referenced base table columns, whether the columns are referenced in the view
definition or in the user query against the view.

In some cases, Oracle cannot merge the view definition with the user-issued query. In
such cases, Oracle may not use all indexes on referenced columns.

视图中使用索引
1. 当 Oracle 整合用户提交的查询语句与其中所引用视图的定义语句并对整合结果进行转化时,将决定此查询如何使用索引.
2. Oracle 会尽可能地将用户查询及其中所引用视图的定义查询进行整合.Oracle 将优化整合后的语句,
就如同用户提交的语句中没有引用视图一样.因此,无论一列是被视图的定义引用,还是被用户提交的查询引用,
Oracle 都可以使用建于基表列上的索引.
3. 有些情况下,Oracle 无法将用户查询与其中所引用视图的定义查询进行整合.此时 Oracle 可能无法使用全部被引用列上的索引.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-981770/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1898099