Alternate indexed views

What is an alternative approach to indexed views in sql server?

Thank you, Salman Shehbaz.

0


a source to share


4 answers


By dumping the contents of the view into pivot tables and placing indexes in their place.



What is the use of indexed views giving you what you would like to try to achieve with an alternative approach.

+3


a source


create the stored procedure of your choice and then execute the stored procedure that you need.



0


a source


I am assuming that you want to index the view using external or self-attachment ( or one of the other constraints ).

Use the regular view or the built-in table function if you want to use it in the FROM clause.

Keep this in mind, however: in a query with indexed views, the optimizer can disable (expand) the view and use the underlying tables if it sees fit. An alternative query will also be added using non-indexed views or built-in table functions.

See my answer here: The Plan Optimization Optimizer works well with bound / filtered table functions AND Tony Rogerson

Otherwise, you can add additional information.

0


a source


Alternative approaches include using the INSTEAD OF trigger on a regular VIEW and using a regular trigger on the underlying tables.

0


a source







All Articles