SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX: Why is MDX so much slower than getting the ALL data from the cube?


MDX: Why is MDX so much slower than getting the ALL data from the cube?

Author
Message
Wood Chuck
Wood Chuck
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 93
I have a pivot grid attached to the cube. The cube has 7 million records and shows all our content really fast

The MDX below produces 217,000 records in 29 seconds (way too slow). Much slower then hooking up to the cube directly. We need to limit what the user sees by specific locations or by state boundaries but I am finding MDX is too slow...

Your guidance is appreciated!!!

----------------------------------------------
MDX CODE for pivot grid to show state, county... locations
-----------------------------------------------
with
set [x] as
{ // this may also be filled with hundreds or thousands of locations...
[Dim Geographic].[Policy].[STATECODE].&[27]
}

SELECT
NON EMPTY{
--([DIMLINEOFBUS].[LINEOFBUSTYPE].MEMBERS, [Measures].MEMBERS),
([DIMLINEOFBUS].[LINEOFBUSTYPE].&[Commercial], [Measures].MEMBERS),
([DIMLINEOFBUS].[LINEOFBUSTYPE].&[Auto], [Measures].MEMBERS),
([DIMLINEOFBUS].[LINEOFBUSTYPE].&[Residential], [Measures].MEMBERS)
} ON COLUMNS,
NON EMPTY {
[x] * //{[Dim Geographic].[STATEABBRV].children} *
{[Dim Geographic].[COUNTYNAME].children} *
{[Dim Geographic].[CITY].children} *
{[Dim Geographic].[POSTALCODE].children} * [Dim Geographic].[LOCATIONID].[LOCATIONID]
} ON ROWS
FROM [Cube];
Mackers
Mackers
SSC Veteran
SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)SSC Veteran (229 reputation)

Group: General Forum Members
Points: 229 Visits: 499
Try
SELECT 
NON EMPTY{
{[Measures].MEMBERS} *
{[DIMLINEOFBUS].[LINEOFBUSTYPE].&[Commercial],
[DIMLINEOFBUS].[LINEOFBUSTYPE].&[Auto],
[DIMLINEOFBUS].[LINEOFBUSTYPE].&[Residential]}
ON COLUMNS,
NON EMPTY {
{[Dim Geographic].[COUNTYNAME].[All].children} *
{[Dim Geographic].[CITY].[All].children} *
{[Dim Geographic].[POSTALCODE].[All].children} *
{[Dim Geographic].[LOCATIONID][All].children}
} ON ROWS
FROM (select [Dim Geographic].[Policy].[STATECODE].&[27] on columns from [Cube]);



Do you need all the measures?
In addition have you set the attribute relationships correctly on the Geography hierarchy? Below is a link to this

http://www.bidn.com/blogs/DevinKnight/ssis/1099/ssas-defining-attribute-relationships-in-2005-and-2008

There is no time selected in the MDX - is this correct?
Have you set aggregations in the cube?

Questions, questions....
Mack
Wood Chuck
Wood Chuck
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 93
Do you need all the measures?
Yes, I need to provide Line of Business in columns of the Pivot Grid.

In addition have you set the attribute relationships correctly on the Geography hierarchy? Yes, I believe they are correct.

There is no time selected in the MDX - is this correct?
Yes, the database is a snapshot in time for the customer. No history.

Have you set aggregations in the cube?
Yes.

Your example query made did help a little but I'm at 26 seconds and need to get down to 2 seconds.

I think one issue may be that my geo. dimension table is has the same number of rows as my fact table. (?)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search