The Dixie Flatline - Friday, January 11, 2019 8:31 PM
Oh, I get all that. Still, an indexed view is a materialization of data and, unless the view is doing data reduction through aggregates, it's not much better than using coving indexes because that's what an indexed view kind of is. As with all else in SQL Server, "It Depends".
The only thing that I don't agree with is the part where a function may automatically pick to use an indexed view instead of the tables that have been cited in the code. I've heard of that "feature" before (and the DTA even has such an option built into it) and I suppose that optimizer could chose to use an index from a materialized view, but I've never seen anyone be able to prove it, especially where the view provides materialized aggregation. Do you have an example or a URL that has such an example handy?
--Jeff Moden
Change is inevitable... Change for the better is not.