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: Using views inside a View

Re: Using views inside a View

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Mon, 21 Feb 2005 21:23:23 +0100
Message-ID: <cvdfrt$g6g$1@news2.zwoll1.ov.home.nl>


GreyBeard wrote:
> On Mon, 21 Feb 2005 17:54:58 +0100, Frank van Bortel wrote:
>
>
>

>>>Of course there is a risk of writing queries that have lousy execution
>>>plans.  It seems to me that risk exists in 'plain' SQL as well as SQL
>>>based on nesting of views.
>>>
>>
>>No - I have the 'no views over views' as an Rule Of Thumb,
>>unless good, proven reasons (explain!) are shown why, where
>>and how.
>>
>>The whole problem is that a view with columns A, B, C, and D
>>and aggregates all over may look as just what I want when I want
>>select A, sum(B) group by A, D, but give a horrible plan.
>>This is not clear as it would be from the "plain SQL" you are
>>referring to.
>>
>>Especially when end-user ad hoc reporting tools are to be used...

>
>
> Please correct my interpretation of your statement:
>
> "Selecting from inappropriate views that do unnecessary work [relative
> to what is needed by the select] can lead to bad execution plans.
>
> Therefore selecting from views is bad."
>

No - I don't go that far; I'd like to change that to: therefore selecting from nested views should only be done with caution by knowledgeable developers.
>
> In some circumstances (such as publishing views to ad-hoc users) I can
> concur that data sources can be used inappropriately.

Meet Mr. Murphy! Mr. Murphy is an optimist.
>
> My take on that is it leads us into a philosophical, not technical,
> discussion (like the one about killers and guns), in which case I can
> agree with you.
>
> FGB
Inline...

-- 
Regards,
Frank van Bortel
Received on Mon Feb 21 2005 - 14:23:23 CST

Original text of this message

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