From: tshad on

"Erland Sommarskog" <esquel(a)sommarskog.se> wrote in message
news:Xns9DD337F94A19Yazorman(a)127.0.0.1...
> tshad (tfs(a)dslextreme.com) writes:
>> He is saying that you should always write views directly to the base
>> tables.
>>
>> "Views can especially degrade the performance if they are based on other
>> views. Therefore, it is recommended NOT to create views based on other
>> views. All views should be created against base tables."
>
> This is both true and untrue. Technically it is untrue, because as Plamen
> says, the expanded query will have the same performance.
>
> But from a practical point of view it is true, because what may happen
> is that you have same table joined to itself multiple times, when you
> only need it in the query once. That is, you would expand the composed
> view into the base tables, you would see that the query can be simplified.
>
> So from that point of view, the advice is not bad, but it is also obvious
> that as long as you know what you are doing, views built on views does
> not have to be bad.
>
Both what you said and Plamen said is what I expected and makes sense. I
was just curious about the article.

As you said it could be bad if you don't know what the views are doing.

Thanks,

Tom
>
> --
> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
>
> Links for SQL Server Books Online:
> SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
> SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
> SQL 2000:
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>