• NineIron (4/17/2014)


    Thanx. So, what's the advantage of adding an index to a view?

    When you access a non-indexed view, SQL will expand the query that defines the view to access the data that is needed. Let's say you have a view with an aggregation in it. SQL will chug through and re-calculate the aggregation every time you access the view. If you index the view, the aggregation may not need to be recalculated every time.

    There are lots of caveats and drawbacks too, but that is one use case.