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

后端 未结 5 1339
既然无缘
既然无缘 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:25

    I don't think there is a good workaround. What you can do about this is to create a real table from the view and set indexes on that. This can be done by a stored procedure that is called regularly when data is updated.

    Select * 
    into 
    From 
    
    create CLUSTERED index  on ()
    

    But this is only a noteworthy approach if data isn't updated every few seconds.

提交回复
热议问题