Indexed Views - why don't they improve performance?!!!!

  • Gazareth (1/23/2013)


    If you change your indexed view definition to:

    CREATE UNIQUE CLUSTERED INDEX [idxTest] ON [dbo].[withClusteredIdx]

    (

    [yy] ASC,

    [mm] ASC,

    [Reference] ASC,

    [MPAN] ASC,

    [ElementID] ASC

    ) go

    I think you'll see this view being used in place of the table.

    Cheers

    You should take this advice.

    Or, better, merge YEAR and MONTH columns together:

    DATEADD(mm, DATEDIFF(mm, 0, hhdatetime), 0) MonthOfYear

    And make this column the first one in the clustered index.

    Then you may just select

    WHERE MonthOfYear between @StartOfThePeriod AND @EndOfThePeriod

    Than you may just use

    _____________
    Code for TallyGenerator

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply