Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

SQL Server 2000 Views and Views containing Views


I was wondering if anyone could shed any light on this. I am using SQL Server
2000.

I start with 1 view (VIEW A) that uses a UNION statement that includes 2
queries. Each query is not too complicated (i.e. few joins but no subquery).

I then run a report and it take a long time to run.

So I decide to make 2 new views each with one query. Then I modify the
original view (VIEW A) to use a UNION statement that combines the 2 views,
rather than the queries.

This runs much faster.

I am surprised by this. Should I be? I have never been a fan of views of
view because of the admin nightmare of too many views. But it seems like
there is a performance advantage. Can this be true?

Have you tried using UNION ALL?
Union by default will remove duplicates and will slow down your select.
Immy
"Paul" <P@discussions.microsoft.com> wrote in message

news:FADCC7BC-F18E-4D8B-A7E4-28642385C58B@microsoft.com...

Have you compared execution plans of setting #1 vs. setting #2? Therein may
the answer lie.

ML

---
http://milambda.blogspot.com/

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc