Re: HOW 'VIEW' WORKS

From: Kevin Loney <"75663,327"_at_compuserve.com>
Date: 1996/10/03
Message-ID: <3253EC54.63DF_at_compuserve.com>#1/1


> Checked it out on V7.1 ... and you're right. Different
> Explain Plans when using a view vs when manually simulating
> the view in the select.
>
> It appears that (in my test case) the kernel resolves the
> view first and then optimizes the rest.
> The optimizer will resolve the view first if it contains a grouping
operation and cannot be combined with the rest of the query. Otherwise, the view's query text is combined with the query that calls it.

If you manually simulate views via FROM clause subqueries, and the subqueries contain grouping operations, then the subquery will be resolved first, rather than being integrated with the rest of the query text. A VIEW operation will show up in the explain plan, with an object name like _from_subquery$2.

-Kevin Loney. Received on Thu Oct 03 1996 - 00:00:00 CEST

Original text of this message