Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: usage of views

Re: usage of views

From: Julio <julio.negueruela_at_si.unirioja.es>
Date: 2000/03/16
Message-ID: <38D0B3D1.FB64638@si.unirioja.es>#1/1

Atta ur-Rehman wrote:
>
> hi Parvinder,
>
> i still am convinced that there are no two quereis when you do a select
> from a view. by defition, if you want to restrict some records off a
> view, the restricting where clause could always be merged with the view
> definition to get a *SINGLE* sql statement. below i'd quote an excerpt
> from Oracle Concept Manual, Chapter 8, Schema Objects:

Both of you are right. :-)
When you query a view Oracle can choose between: . Merging the view's query with yours and accessing the view's base table. This will be done as possible.
. Executing the view's query and then fire your query on the rows resulted. This way will be choosen whem merging is not possible: Views created as compound queruies (unionm intersect), group by/connect by clauses or group functions.

In Madhuri's case Oracle would merge the view with the query and would execute:

select * from xyz where b.2 = 'some value'

                   and where a.1 = b.1;

What looks like the original query, so it won't be either slower or faster. :-)

Regards.

-- 
Julio Negueruela

'Hay algunas cosas que son tan serias 
que solo puedes bromear con ellas.' (Bohr)
Received on Thu Mar 16 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US