我已经设置了一个索引视图,我打算将其用作 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
一个有自己索引的表?