![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am seeing a performance problem when making the following queries in the Project Real database: --------------------------------------------------------------------------- SELECT { [Measures].[Sale Amt] } TYPE ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Item].[Publisher Name].[All], [Item].[Publisher Name].[Publisher Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Item].[By Category].[Subject].&[174], [Vendor].[Vendor Name].&[PENGUIN GROUP (USA) PAPERBACKS] ) --------------------------------------------------------------------------- The query takes about 2:30 to run. I found two different ways to improve the performance. The first is remove the sorting (i.e., ORDER) from the query reduces the query down to 3 seconds, but the results are not ordered correctly. The second solution is to replace the attribute hierarchy ([Vendor].[Vendor Name]) in the where clause with the corresponding strong hierarchy ([Vendor].[Vendor].[Vendor Name]). This also reduces the response time to a few seconds. Why does sorting behave differently between an attribute hierarchy and a strong (user-defined) hierarchy? This MDX query takes more then 30 minutes: --------------------------------------------------------------------------- SELECT NON EMPTY { [Measures].[Sale Amt] } ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Customer].[Customer].[All], [Customer].[Customer].[Customer Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Time].[Calendar].[Calendar Qtr].&[4]&[2004], [Item].[Author].&[SOLLORS W], [Item].[By Category].[Subject].&[87], [Item].[Item].&[5932398], [Item].[Publisher Name].&[New York University Press], [Store].[Geography].[City].&[Arlington Heights], [Vendor].[Vendor].[Vendor Name].&[NEW YORK UNIVERSITY PRESS] ) --------------------------------------------------------------------------- The same solutions drastically reduce the response time. Here are some Adventure works examples: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[City].&[Spokane]&[WA]) ---------------------- Takes 5 seconds, but replacing the attribute hierarchy with the strong returns the results in 1 second: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[Customer Geography].[City].&[Spokane]&[WA]) ----------------------- -- Brandon Stirling ProClarity Corp. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
other question... where is the "Project Real" database??? I don'T see any download anywhere... "Brandons" <Brandons (AT) discussions (DOT) microsoft.com> wrote in message news:9CD7052D-D03E-4C4C-8BDC-D860F8BB7D8B (AT) microsoft (DOT) com... I am seeing a performance problem when making the following queries in the Project Real database: --------------------------------------------------------------------------- SELECT { [Measures].[Sale Amt] } TYPE ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Item].[Publisher Name].[All], [Item].[Publisher Name].[Publisher Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Item].[By Category].[Subject].&[174], [Vendor].[Vendor Name].&[PENGUIN GROUP (USA) PAPERBACKS] ) --------------------------------------------------------------------------- The query takes about 2:30 to run. I found two different ways to improve the performance. The first is remove the sorting (i.e., ORDER) from the query reduces the query down to 3 seconds, but the results are not ordered correctly. The second solution is to replace the attribute hierarchy ([Vendor].[Vendor Name]) in the where clause with the corresponding strong hierarchy ([Vendor].[Vendor].[Vendor Name]). This also reduces the response time to a few seconds. Why does sorting behave differently between an attribute hierarchy and a strong (user-defined) hierarchy? This MDX query takes more then 30 minutes: --------------------------------------------------------------------------- SELECT NON EMPTY { [Measures].[Sale Amt] } ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Customer].[Customer].[All], [Customer].[Customer].[Customer Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Time].[Calendar].[Calendar Qtr].&[4]&[2004], [Item].[Author].&[SOLLORS W], [Item].[By Category].[Subject].&[87], [Item].[Item].&[5932398], [Item].[Publisher Name].&[New York University Press], [Store].[Geography].[City].&[Arlington Heights], [Vendor].[Vendor].[Vendor Name].&[NEW YORK UNIVERSITY PRESS] ) --------------------------------------------------------------------------- The same solutions drastically reduce the response time. Here are some Adventure works examples: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[City].&[Spokane]&[WA]) ---------------------- Takes 5 seconds, but replacing the attribute hierarchy with the strong returns the results in 1 second: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[Customer Geography].[City].&[Spokane]&[WA]) ----------------------- -- Brandon Stirling ProClarity Corp. |
#5
| |||
| |||
|
|
Project is REAL is a series or white papers starting with http://msdn.microsoft.com/library/de...05InSrREAL.asp. I am not sure it can be downloaded outside of Microsoft. -- Brandon Stirling "Jéjé" wrote: other question... where is the "Project Real" database??? I don'T see any download anywhere... "Brandons" <Brandons (AT) discussions (DOT) microsoft.com> wrote in message news:9CD7052D-D03E-4C4C-8BDC-D860F8BB7D8B (AT) microsoft (DOT) com... I am seeing a performance problem when making the following queries in the Project Real database: --------------------------------------------------------------------------- SELECT { [Measures].[Sale Amt] } TYPE ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Item].[Publisher Name].[All], [Item].[Publisher Name].[Publisher Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Item].[By Category].[Subject].&[174], [Vendor].[Vendor Name].&[PENGUIN GROUP (USA) PAPERBACKS] ) --------------------------------------------------------------------------- The query takes about 2:30 to run. I found two different ways to improve the performance. The first is remove the sorting (i.e., ORDER) from the query reduces the query down to 3 seconds, but the results are not ordered correctly. The second solution is to replace the attribute hierarchy ([Vendor].[Vendor Name]) in the where clause with the corresponding strong hierarchy ([Vendor].[Vendor].[Vendor Name]). This also reduces the response time to a few seconds. Why does sorting behave differently between an attribute hierarchy and a strong (user-defined) hierarchy? This MDX query takes more then 30 minutes: --------------------------------------------------------------------------- SELECT NON EMPTY { [Measures].[Sale Amt] } ON COLUMNS , NON EMPTY { ORDER( { DESCENDANTS( [Customer].[Customer].[All], [Customer].[Customer].[Customer Name] ) }, ( [Measures].[Sale Amt] ), BDESC ) } ON ROWS FROM [REAL Warehouse] WHERE ( [Time].[Calendar].[Calendar Qtr].&[4]&[2004], [Item].[Author].&[SOLLORS W], [Item].[By Category].[Subject].&[87], [Item].[Item].&[5932398], [Item].[Publisher Name].&[New York University Press], [Store].[Geography].[City].&[Arlington Heights], [Vendor].[Vendor].[Vendor Name].&[NEW YORK UNIVERSITY PRESS] ) --------------------------------------------------------------------------- The same solutions drastically reduce the response time. Here are some Adventure works examples: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[City].&[Spokane]&[WA]) ---------------------- Takes 5 seconds, but replacing the attribute hierarchy with the strong returns the results in 1 second: ---------------------- select { [Measures].[Internet Order Count] } on columns, NON EMPTY { ORDER ({ DESCENDANTS([Product].[Product].[All Products] ,[Product].[Product].[Product] ) }, ( [Measures].[Internet Order Count] ), BDESC ) } ON ROWS from [Adventure Works] where ([Customer].[Customer Geography].[City].&[Spokane]&[WA]) ----------------------- -- Brandon Stirling ProClarity Corp. |
![]() |
| Thread Tools | |
| Display Modes | |
| |