现在的位置: 首页 > 综合 > 正文

index on view

2013年03月24日 ⁄ 综合 ⁄ 共 476字 ⁄ 字号 评论关闭

It is not possible in a view but Index can be created on Materialized View.

You should understand that view is nothing but a mask on a table with certain restriction,
which will have pointers to the actual data. Views do not occupy any space. So, obviously you cannot create an index on a view.

A view is really just a stored
SQL statement so if you want to create an index on a view, create the index on the base table instead. Here is an example from the scott schema.


create or replace view emp_dept as
 select e.empno, e.ename, deptno, d.dname
 from emp e join dept d using (deptno);

抱歉!评论已关闭.