• Evil Kraig F (8/22/2012)


    Just on a side note, be careful with indexed views, particularly top 10 views and the like. On paper it doesn't look like they'll cost much overhead, they're only monitoring 10 rows. In reality, they're not.

    Views that contain TOP cannot be indexed directly, so this specific issue does not really arise in these terms.

    Almost every update/insert/delete on any connected table will cause this view to refresh.

    Maintenance to an indexed view is built in to the query plan of the statement that causes a change to the view. In general, the maintenance is incremental, affecting only those rows in the indexed view that are directly affected by the change. I'm sure you knew this Craig, but I wanted to make it clear for other readers that it is not the whole view that is refreshed whenever a change occurs.