dbTalk Databases Forums  

How to increase speed of query?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How to increase speed of query? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Polly
 
Posts: n/a

Default How to increase speed of query? - 07-23-2004 , 10:48 PM






Dear all,

I would like to know whether there are some methods to improve the speed of query in Excel. Coz I spent a few second to get the result using the following MDX statement. However, it took about 15 mins to get the same result in Excel.


MDX statement:
WITH
MEMBER [Measures].[Net Amount] AS
'[Measures].[Gross Amount] - [Measures].[Discount Amount]',
SOLVE_ORDER = 1
MEMBER [Measures].[Unit Price] AS
'[Measures].[Net Amount] / [Measures].[Qty]',
SOLVE_ORDER = 2
select
{ crossjoin({[Branch].[Store A],[Branch].[Store B], [Branch].[Store C],
[Branch].[Store D], [Branch].[Store E], [Branch].[Store F],
[Branch].[Store G]},
{[Measures].[Qty], [Measures].[Unit Price],[Measures].[Net Amount]})}
on columns,
non empty{ nonemptycrossjoin({[Supplier].[Suppcname].members}, {[Item Category].[Chicken].children})} on rows
from
[Receiving Datawarehouse]
where
([Delivery Date].[2004].[June], [Section].[All Section].[Kitchen] )

Please help me to improve the speed! Thanks in advance!

Best Wishes,
Polly

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: How to increase speed of query? - 07-26-2004 , 12:31 AM






Presumably Excel is not generating NonEmptyCrossJoin() for the rows,
causing the MDX query to take longer. If both the calculated measures:
[Net Amoount] and [Unit Price] should be empty when [Gross Amount] is,
then setting their Non Empty Behavior Property to [Gross Amount] should
help:

http://groups.google.com/groups?hl=e...cLMNk%24DHA.14
52%40TK2MSFTNGP09.phx.gbl
Quote:
From: Deepak Puri (deepak_puri (AT) progressive (DOT) com)
Subject: Re: Problems with Calculated member -- Correction
View: Complete Thread (4 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2004-02-28 13:40:56 PST


Hi Subhash,

This is the best [MS] documentation that I found:

http://support.microsoft.com/default...b;en-us;304137
Quote:
INF: How to Increase the Speed of MDX Queries that Contain the NON EMPTY
Keyword

View products that this article applies to.

This article was previously published under Q304137
SUMMARY

In some cases, a query slows down considerably when you use both the NON
EMPTY keyword on an axis of a Multidimensional Expression together with
a calculated member.

This article describes how you can optimize a query, by using the Non
Empty Behavior property for the calculated member.

MORE INFORMATION

Use of the NON EMPTY keyword on a MDX statement causes the calculated
member to evaluate the calculated member's expression for each member to
determine whether or not the member is empty. The extra time taken for
the evaluation is what causes the NON EMPTY keyword to slow down the MDX
query.

To optimize a query that uses the NON EMPTY keyword, set the Non Empty
Behavior property to a base measure of the cube, so that if the base
measure is empty the calculated member's value is considered empty and
the expression is never evaluated, which increases the query
performance.

How to Enable the Non Empty Behavior Property

To enable the Non Empty Behavior property, use these steps:
Right-click the Sales cube, and then click Edit.

In the Cube Editor, scroll down to the Calculated Members folder.

By default, the Calculated Members folder is expanded. Select the
calculated member Sales Average, and then click Properties to open the
Properties pane for the Sales Average calculated member.

In the list of properties, locate the Non Empty Behavior drop-down list
box and click Store Count.
Save the cube.
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #3  
Old   
Polly
 
Posts: n/a

Default Re: How to increase speed of query? - 07-29-2004 , 09:51 PM



Dear Deepak Puri,

Thanks for your reply.

Using Non Empty Behavior Property can improve the speed of getting "Measures" information in Excel. However, when I dragged "Supplier" and "Item Category" to row, the speed was still slow. Is there any way to improve the speed of this part? Thanks!

Best Wishes,
Polly


Reply With Quote
  #4  
Old   
Deepak Puri
 
Posts: n/a

Default Re: How to increase speed of query? - 07-31-2004 , 10:42 PM



Polly,

Defining the "Non Empty Behavior" Property for ALL the calculated
measures included in a pivot table usually results in significant
savings in query time, WITH multiple dimensions on rows (ie.
cross-joins). Did you find no noticeable difference in query time after
doing so?


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.