What to replace left join in a view so i can have an indexed view?

后端 未结 5 1366
既然无缘
既然无缘 2020-12-31 00:43

I have normalized tables in a database and to denormalize it, I created a view out of two tables. When I tried to create a clustered index on the view, it wouldn\'t let me,

5条回答
  •  再見小時候
    2020-12-31 01:11

    I'll work on an answer to 1, but for now:

    [2]. The view will be no more nor less performant than the equivalent query on the udnerlying tables. All the usual advice applies about having covering indexes, preferably an index on the joined columns, etc.

    [3]. There's no real workaround. Most of the restrictions on indexed views exist for very good reasons, once you dig into them.

    I'd just create the view, generally, and do no more, unless there was a specific performance problem.

    I'll try to add an answer for 1 once I've reconstructed it in my own mind.

提交回复
热议问题