Indexed View
- From: "Michael C" <mikec@xxxxxxxxxx>
- Date: Thu, 14 May 2009 10:53:03 +1000
I'm playing around with turning an existing view into an indexed view. This
view has been used throughout our app so hopefully speeding up this view
will improve speed in many places. I managed to get it all working except
for one part. The view looks something like this
SELECT Blah1, Blah2, etc
FROM dbo.Table1
JOIN dbo.Table2 ON Table1.Blat1 = Table2.Blat2
WHERE this = that etc
So far so good but we have a table which simply lists rows that should be
excluded, which we add to the query with a not exists
AND NOT EXISTS (SELECT * FROM dbo.ExcludeTable WHERE ExcludeTable.Blah =
Table1.Blah)
The alternative is to use a left join but indexed views don't like that
either. Is there anything I can do? I know I can change the data structure
(to, say have an exclude bit in table1) but I didn't make these tables and
changing them would require a lot of pain. Is there anything I can do
without changing the tables?
Thanks again,
Michael
.
- Follow-Ups:
- Re: Indexed View
- From: John Bell
- Re: Indexed View
- Prev by Date: Re: Concatenate Date and Time
- Next by Date: Re: For Celko, help with ANSI Standard SQL
- Previous by thread: Concatenate Date and Time
- Next by thread: Re: Indexed View
- Index(es):
Relevant Pages
|