EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB204258: SQL Global Optimization "Level 4: Level 2 + Merge All Passes with Different WHERE." option presents GODWFLAG in report SQL even if all metrics are set to outer join in MicroStrategy Analytics Developer 9.4.1


Stefan Zepeda

Salesforce Solutions Architect • Strategy


The user has a report where the VLDB property of SQL Global Optimization has been set as "Level 4:  Level 2 + Merge All Passes with Different WHERE." All the metrics in the report have been specified with outer joins

SYMPTOM:
The user has a report where the VLDB property of SQL Global Optimization has been set as "Level 4:  Level 2 + Merge All Passes with Different WHERE." All the metrics in the report have been specified with outer joins, so theoretically the engine should not generate GODWFLAG in cube SQL and all rows of the intermediate table are preserved. However, the user still sees GODWFLAG in the cube SQL which has infected the performance of engine.

ka04W000001IqXbQAK_0EM440000002CE6.jpeg

 
The sample report contains attribute ‘Region’ and metric ‘Filtered Profit’ and ‘Profit’. Both metrics have been set to outer joins.

ka04W000001IqXbQAK_0EM440000002CE4.jpeg

 
However, GODWFLAG is still seen in report SQL as highlighted below.

ka04W000001IqXbQAK_0EM440000002CDr.jpeg

 
CAUSE:
 
There is a nested aggregation metric A with a metric condition C, and the component metric B is also on template. When calculating metric A, the condition C will also be applied to the inner component metric B. Thus from Strategy Engine’s perspective, there are two metrics with same formula but different condition: metric A without condition; metric A with condition.
 

ka04W000001IqXbQAK_0EM440000002CE0.jpeg

According to the SQL Optimization logic, these SQL passes are combined together – if setting GO to level 0, there are similar SQL passes (half with condition C filtering, half not) . However, in order to correctly calculate the outer join metric A, it needs to use GODWFLAG to distinct the rows. Without GODWFLAG, there is no way to apply the filter while combining the SQL passes.
 
So the existence of GODWFLAG is expected as metric A and B are not independent from each other though they are all outer join metrics.
 
To learn more about how the Global Optimization levels 3 and 4 handle inner and outer joins between metrics in Strategy SQL Generation Engine, the below technical note can be used as reference.KB20586: How do Global Optimization levels 3 and 4 handle inner and outer joins between metrics in MicroStrategy SQL Generation Engine?


Comment

0 comments

Details

Knowledge Article

Published:

May 17, 2017

Last Updated:

May 17, 2017