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

KB484907: Eliminate unnecessary Cross Join to improve performance when the Cross Join table is only added to apply unrelated filter with Data Engine Version 2021


Min Zhao

Quality Engineer, Principal • MicroStrategy


This article explains a scenario that unnecessary Cross Join is eliminated to improve performance when the Cross Join table is only added to apply unrelated filter with Data Engine Version 2021.

Starting with the release of Strategy ONE (March 2024), dossiers are also known as dashboards.
Steps to Reproduce
This procedure is using Strategy Tutorial WH that is shipped with Strategy products.

  1. Login Strategy Web, go to Add External Data -> Databases -> Select Tables, pick the following tables
ka0PW0000001JfYYAU_0EM4W0000026vDl.png
  1. Click Finish and choose Import as an In-memory Dataset, save as MTDI
ka0PW0000001JfYYAU_0EM4W0000026vDm.png
  1. Create dossier based on MTDI, create derived metric DM with expression: Count<Distinct=True>([Region Id]@ID){~+}
ka0PW0000001JfYYAU_0EM4W0000026vDn.png

 
 

  1. Add into Visualization: Country Id, DM, add into filter: Year Id in {2009}
  2. View Query Details, the filter is applied through Cross Join

************   Individual Step Start   ************
Number of Rows Returned:
Time Spent:
Query Execution Start Time: 3/17/2021 11:56:24 AM
Query Execution End Time:
Tables Accessed:
Table0       [L_YEAR_ID]:     Year Id,               LOOKUP_TABLE       
Table12     [F_LU_REGIONA5C81E636B9E498EB34349C5736EDA14]:          Country Id, Region Id, Region Name,         Row Count - LU_REGION, FACT_TABLE   
select         [Country Id]@[COUNTRY_ID],
          count(distinct [Region Id]@[REGION_ID])@{[Country Id]} as [DM]
from  LU_MONTH LU_REGION (2 tables)
with Table Join Tree:   [F_LU_REGIONA5C81E636B9E498EB34349C5736EDA14]
           CrossJoin [L_YEAR_ID]<[Year Id]@[YEAR_ID] in (2009)> with output level Tuple([Region Id]@[REGION_ID], [Country Id]@[COUNTRY_ID], [Year Id]@[YEAR_ID])
************   Individual Step End     ************
Cause
This is a known issue in Strategy.
Solution
This issue has been addressed in Strategy 2021.
To pick up the fix, upgrade to Strategy 2021 or above and enable project level setting "Data Engine Version" to 2021 or above. For more details on enabling the setting, refer to Change Data Engine Version
After the fix, the cross join is eliminated.
************   Individual Step Start   ************
Number of Rows Returned: 6
Time Spent: 0.008 sec(s)
Query Execution Start Time: 3/17/2021 12:01:59 PM
Query Execution End Time: 3/17/2021 12:01:59 PM
Tables Accessed:
Table12     [F_LU_REGIONA5C81E636B9E498EB34349C5736EDA14]:          Country Id, Region Id, Region Name,         Row Count - LU_REGION, FACT_TABLE   
select         [Country Id]@[COUNTRY_ID],
          count(distinct [Region Id]@[REGION_ID])@{[Country Id]} as [DM]
from  LU_MONTH LU_REGION (2 tables)
with Table Join Tree:   [F_LU_REGIONA5C81E636B9E498EB34349C5736EDA14]
************   Individual Step End     ************
Strategy internal reference number for this technical note is DE170931.


Comment

0 comments

Details

Knowledge Article

Published:

March 3, 2021

Last Updated:

March 21, 2024