Indexed Views – SQLServerCentral
Indexed Views – SQLServerCentral.
This post describes an interesting feature that I have never been able to use. Unfortunately, indexed views come with a fairly long list of restrictions and I always seem to run afoul of at least one of them.
If you can’t use an indexed view because of the restrictions, but your data is in fact deterministic, then a workaround that I have used is to create an explicit table from the view using SELECT INTO, and then create the required indexes against it. This does the same thing, in effect, as an indexed view but without the restrictions.
Of course if there is a restriction that prevents creating an indexed view then you should examine closely to make sure that your workaround, whatever it might be, will still produce the correct results in all situations.
Update (5/22/13): I think I now see a way to take good advantage of indexed views, after using the above-mentioned workaround to pull all the external related data into the same database — specifically data that would otherwise only be accessible through Master Data Services subscription views (which can also be extremely slow sometimes). More later, if it works.
Comments
Indexed Views – SQLServerCentral — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>