我已經設置了一個索引視圖,我打算將其用作SSAS多維數據集的數據源視圖。索引視圖看起來是這樣的:帶有(NOEXPAND)和SSAS多維數據集的索引視圖
create view vw_indexed1 with schemabinding
as
select
key1,
key2,
count_big(*) as bigcount
from
table1
group by
key1,
key2,
GO
CREATE UNIQUE CLUSTERED INDEX [PX_vw_indexed1] ON [dbo].[vw_indexed1]
(
key1,
key2,
)WITH
(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = ON, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
現在,當我去select * from vw_indexed1
它需要年齡,大概是因爲它正試圖擴大在基礎表中的索引,這樣的話我會用select * from vw_indexed1 with (noexpand)
,執行就像直接在具有聚簇索引的表上選擇。
我的問題是這樣的:如果我將這個視圖用作SSAS項目的DSV,是否每次嘗試使用底層索引?如果是這樣,我怎麼能強迫它考慮vw_indexed1
作爲一個表與自己的索引?