这个查询花了太多时间来执行结果集,有没有办法优化查询
WITH MEMBER PatientName AS [DimPatient].[Full Name].CurrentMember.Member_Caption
MEMBER PatientAge AS [DimPatient].[Age].CurrentMember.Member_Caption
MEMBER PatientGender AS [DimPatient].[Gender].CurrentMember.Member_Caption
MEMBER PatientMRN AS [DimPatient].[Medical Record Number].CurrentMember.Member_Caption
MEMBER PCPList AS [DimPCP].[Provider Key].CurrentMember.Member_Caption
MEMBER CareTeamList AS [DimCareTeam].[CareTeamName].CurrentMember.Member_Caption
MEMBER ConditionList AS [DimCondition].[Condition Name].CurrentMember.Member_Caption
SELECT (([DimPatient].[Patient Key].[Patient Key],
[DimPCP].[Provider Key].[Provider Key],
[DimCareTeam].[CareTeamName].[CareTeamName],
[DimCondition].[Condition Name].[Condition Name])) ON 1 ,
{ [Measures].[PatientName] ,
[Measures].[PatientAge] ,
[Measures].[PatientGender] ,
[Measures].[PatientMRN] ,
[Measures].[Num Of Minutes] ,
[PCPList] ,[CareTeamList] ,
[ConditionList] } ON 0 FROM [NavigateCube]
WHERE ( [DimManagedPopulation].[ManagedPopulationKey].&[5059],[DimAnchorDate].[Date Key].&[20160930] )
答案 0 :(得分:0)
您可以尝试以下方法吗?无需构建返回维度标题的度量。并且NON EMPTY
应该通过仅返回有意义的维度组合来加速它(与我假设的Num of Minutes组合):
SELECT NON EMPTY (([DimPatient].[Patient Key].[Patient Key],
[DimPatient].[Full Name].[Full Name],
[DimPatient].[Age].[Age],
[DimPatient].[Gender].[Gender],
[DimPatient].[Medical Record Number].[Medical Record Number],
[DimPCP].[Provider Key].[Provider Key],
[DimCareTeam].[CareTeamName].[CareTeamName],
[DimCondition].[Condition Name].[Condition Name])) ON 1 ,
{ [Measures].[Num Of Minutes] } ON 0
FROM [NavigateCube]
WHERE ( [DimManagedPopulation].[ManagedPopulationKey].&[5059],[DimAnchorDate].[Date Key].&[20160930] )