ordered_hint
My understanding is that views are basically a convienece for the user
and that the SQL parser replaces the view with the base tables before
proceeding any farther. Somewhat akin to preprocessing #include
directives in C before compiling.
For instance, if your view was
Creat view v1
CREATE OR REPLACE VIEW v1
AS select t2.colb, t2.coly
from t2, t3
where t2.id=t3.id
Your query will be parsed as if you actually submitted:
select --+ordered
t1.cola, t2.colb
from t1,t2,t3
where t1.colx = v2.coly
and t2.id=t3.id
Any statistics or indicies on the base tables will be used to generate
the execution plan for the query.
In this case, the ordered hint *should* cause the optimizer to join the
tables in the order that they are listed in the view. DISCLAIMER: I
haven't tested it.
//Walt
|