Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6987633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:57:46+00:00 2026-05-27T18:57:46+00:00

I am programmaticly generating a MDX query in the following format: WITH MEMBER [Measures].[MTD]

  • 0

I am programmaticly generating a MDX query in the following format:

WITH 
    MEMBER [Measures].[MTD] AS
        SUM ({[Time].[Calendar].[Date].&[2011-11-01T00:00:00]:[Time].[Calendar].[Date].&[2011-11-30T00:00:00]
        * {[Dimension1].[Dimension1].[Val1]}
        * {[Dimension2].[Dimension2].[Val2]}
        * {[Dimension3].[Dimension3].[Val3]}
        * {{[Dimension4].[Dimension4].[XXXX],[Dimension4].[Dimension4].[DBS],[Dimension4].[Dimension4].[FD],[Dimension4].[Dimension4].[GSCFDASIA],[Dimension4].[Dimension4].[FDEM],[Dimension4].[Dimension4].[DX],[Dimension4].[Dimension4].[OSWP],[Dimension4].[Dimension4].[OOO],[Dimension4].[Dimension4].[CFD]}}
        * {-{[Dimension5].[Dimension5].[SELI],[Dimension5].[Dimension5].[SELE],[Dimension5].[Dimension5].[MRDN],[Dimension5].[Dimension5].[WCSG],[Dimension5].[Dimension5].[NEWB],[Dimension5].[Dimension5].[VASS]}}
        }, [Measures].[Trade Count])

As you can see, it’s a simple way to create an intersection of dimensional values, and it has been working great for some time.

Recently i rewrote the cube from using a single dimension table with many attributes, to using a separate table for each dimension (for processing performance reasons)

The problem, is that when i filter by Dimension4 and Dimension5 together, it is all of a sudden really slow! if i comment out dimension4 and 5, the query takes a second.. if i un-comment Dimension4 query takes 40 seconds.. if i then un-comment Dimension5 line, the query takes 8 minutes.

the dimension is joined to the measure by ID field (int)

the dimension has 238 values

if i do a simple query:

select count on Columns, {-{[Dimension5].[Dimension5].[SELI],[Dimension5].[Dimension5].[SELE],[Dimension5].[Dimension5].[MRDN],[Dimension5].[Dimension5].[WCSG],[Dimension5].[Dimension5].[NEWB],[Dimension5].[Dimension5].[VASS]}} on rows from MyCube

the query takes sub second. It is something about having a combination of dimensions (up top) that is making it so painfully slow. No idea how to troubleshoot it.

something that may be worth noting, is that my cube has 13 partitions, and i have not set up “partition aggregation” step while setting up partitions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:57:46+00:00Added an answer on May 27, 2026 at 6:57 pm

    After a lot of trial and error, I got my query to process in 6 minutes (from 3.5 hours).

    2 things allowed me to optimize it this way:

    1. Use Month/Year members in Date Range instead of Dates
    Before:

    SUM ({[Time].[Calendar].[Date].&[2011-11-01T00:00:00]:[Time].[Calendar].[Date].&[2011-11-30T00:00:00]
    

    After

    SUM ({[Time].[Month].&[2011-11-01T00:00:00]
    

    This was huge. Since OLAP treats each date member as a separate entity, it cross joins all the dates in the range, with all other filters. In my case, i wanted a full month, or full year, so there was no need for a date range.

    2. Put all common filters (in all the members) into common WHERE clause

    In my case, i had quite a few members sharing the same filters. Simply putting them into the bottom of the query, sped things up another 40%.

    In the end, my query went from 4 hours, to 6.5 minutes. I can further speed it up by adding appropriate aggregations in my cube definition. but didn’t get to that part yet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am programmatically generating an Office Open XML document (Word 2007 format), and would
I am generating audio programmatically. I hear gaps of silence between my buffers. When
Does anyone know how to programmaticly find out where the java classloader actually loads
I try to edit ODT-documents programmaticly in PHP. In fact I just want to
Is there a way to programmaticly get the failed logon count for local Windows
I'd like to learn how, or if its possible at all to programmaticly interact
I am dynamically generating new classes (using Javassist) and I would like to be
I want to run a cron rake task every time a record is updated
I am looking for a .NET library for programmatically generating tables, stored procedures, views
we are generating an Excel report and we need to sort the data programmatically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.