MDX查询需要时间

时间:2017-08-09 11:33:49

标签: ssas mdx

我提到了MDX查询,这需要花费太多时间来执行。供应商维度有~90k数据。


    SELECT NON EMPTY { [Measures].[Amt] } on Columns
FROM ( SELECT ({ Filter([Vendor].[Hr_Vendor].[Vendor],
                [Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUINTILES TRANSNATIONAL KOREA CO LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO INC'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO BA'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO AGT SA'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO BEL NV'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO CAN INC'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO AGENCIA EN'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO PHARM'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO COMMERCIAL GMBH'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO COMMERCIAL PTY LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO COMMERCIAL LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO TE LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO HK'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO IMS'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO MIS INC'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO MIS IRE LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='CONG TY TNHH QUNTICO NAM'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO PT'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO LAB'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO MI INC'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO S DE RL DE CV'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO DEV CO LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO SERVICES'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO SERVICES'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO PROF SRV CTR'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO SL'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO SPA'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO TRA LTD'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTICO K K'),
                Filter([Vendor].[Hr_Vendor].[Vendor],[Vendor].[Hr_Vendor].CURRENTMEMBER.Name='QUNTIC`CO UK')}
    ) ON COLUMNS 
from [Cube])

1 个答案:

答案 0 :(得分:2)

为什么这么复杂?

select [Measures].[Amt] on 0
from [Cube]
where
{
    [Vendor].[Hr_Vendor].[QUINTILES TRANSNATIONAL KOREA CO LTD],
    [Vendor].[Hr_Vendor].[QUNTICO INC],
    [Vendor].[Hr_Vendor].[QUNTICO],
    [Vendor].[Hr_Vendor].[QUNTICO BA],
    [Vendor].[Hr_Vendor].[QUNTICO AGT SA],
    [Vendor].[Hr_Vendor].[QUNTICO BEL NV],
    [Vendor].[Hr_Vendor].[QUNTICO CAN INC],
    [Vendor].[Hr_Vendor].[QUNTICO AGENCIA EN],
    [Vendor].[Hr_Vendor].[QUNTICO PHARM],
    [Vendor].[Hr_Vendor].[QUNTICO COMMERCIAL GMBH],
    [Vendor].[Hr_Vendor].[QUNTICO COMMERCIAL PTY LTD],
    [Vendor].[Hr_Vendor].[QUNTICO COMMERCIAL LTD],
    [Vendor].[Hr_Vendor].[QUNTICO TE LTD],
    [Vendor].[Hr_Vendor].[QUNTICO HK],
    [Vendor].[Hr_Vendor].[QUNTICO IMS],
    [Vendor].[Hr_Vendor].[QUNTICO MIS INC],
    [Vendor].[Hr_Vendor].[QUNTICO MIS IRE LTD],
    [Vendor].[Hr_Vendor].[CONG TY TNHH QUNTICO NAM],
    [Vendor].[Hr_Vendor].[QUNTICO PT],
    [Vendor].[Hr_Vendor].[QUNTICO LAB],
    [Vendor].[Hr_Vendor].[QUNTICO LTD],
    [Vendor].[Hr_Vendor].[QUNTICO MI INC],
    [Vendor].[Hr_Vendor].[QUNTICO S DE RL DE CV],
    [Vendor].[Hr_Vendor].[QUNTICO DEV CO LTD],
    [Vendor].[Hr_Vendor].[QUNTICO SERVICES],
    [Vendor].[Hr_Vendor].[QUNTICO SERVICES],
    [Vendor].[Hr_Vendor].[QUNTICO PROF SRV CTR],
    [Vendor].[Hr_Vendor].[QUNTICO LTD],
    [Vendor].[Hr_Vendor].[QUNTICO SL],
    [Vendor].[Hr_Vendor].[QUNTICO SPA],
    [Vendor].[Hr_Vendor].[QUNTICO TRA LTD],
    [Vendor].[Hr_Vendor].[QUNTICO K K],
    [Vendor].[Hr_Vendor].[QUNTIC`CO UK]
}