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

KB483601: Data Engine Generates unnecessary temporary cubes when applying filter with duplicated conditions


Qinyi Chen

Quality Engineer, Principal • Strategy


Before MicroStrategy 2020, when applying a filter that contains duplicated conditions, the Engine may generate the same temporary result multiple times and cannot reuse them for better performance.

Starting with the release of Strategy ONE (March 2024), dossiers are also known as dashboards.

Symptom

  • The report or dossier uses at least one filter that contains duplicated conditions
  • The same temporary result is generated multiple times in CSI
  • Negative performance impact is observed

Glossary

  • What is CSI?
  • Query Detail – A way to check the CSI statements.
  • Filter

Steps to Reproduce


The following example uses Strategy Tutorial tables.
1. Open Strategy Web.
2. Create 2 datasets.
a.    Create the new dataset DS1:
i.    Add External Data > Databases > Select Tables.
ii.    Select "CITY_MNTH_SLS" table and “LU_MONTH” table from the Tutorial warehouse.
iii.    Keep only 3 attributes in “LU_MONTH” like below, and choose “Do Not Import” for all other attributes.

ka0PW0000001JexYAE_0EM2R000000lvkV.jpeg

iv.    Click the table menu on “LU_MONTH” and choose “Define Relationships”.
v.    Click “Add New” to define 2 new one-to-many relationships like below.

ka0PW0000001JexYAE_0EM2R000000lvl9.jpeg

vi.    Click “Finish” and choose to import as an In-Memory Dataset.
b.    Create the new dataset DS2:
i.    Add External Data > Databases > Select Tables.
ii.    Select the "LU_MONTH" table from the Tutorial warehouse.
iii.    Keep only 4 attributes and 1 metric in “LU_MONTH” like below, choose “Do Not Import” for all other elements.

iv.    Click the table menu on “LU_MONTH” and choose “Define Relationships”.
v.    Click “Add New” to define 3 new one-to-many relationships like below.

ka0PW0000001JexYAE_0EM2R000000lvln.jpeg

vi.    Click “Finish” and choose to import as an In-Memory Dataset. 
3. Link the attribute “Month Id” in DS1 and DS2.
4. Choose to edit filter in the visualization menu to add new filters like below. Note that the "Month Of Year" sub-filters are the same.

ka0PW0000001JexYAE_0EM2R000000lvls.jpeg

5. Add attribute “Year Id” and metric “Tot Cost” to the visualization.

ka0PW0000001JexYAE_0EM2R000000lvlx.jpeg

6. Go to visualization menu and choose Query Details to check the CSI, we can find there are 2 Individual Steps creating two temporary results tempcube 0 and tempcube 2 for later use, but they are exactly same.

ka0PW0000001JexYAE_0EM2R000000lvm2.jpeg

In the last step, both tempcube 0 and tempcube 2 are used for filtering.

ka0PW0000001JexYAE_0EM2R000000lvm8.jpeg

Cause

This is a known behavior before Strategy 2020.
When a filter is analyzed, the Data Engine used to process each filter condition separately. In the above example, though the two sub-filter to choose “Month Of Year” in list 1,2,3 are the same, the temporary results for both of them need to be generated. 

Solution

Starting from Strategy 2020, for duplicated filter conditions, the Engine will only calculate the temporary result once and reused for the same filter conditions, so that the performance can be improved.
After the fix, if user examine the Query Detail, CSI should show reused temporary cube.

ka0PW0000001JexYAE_0EM2R000000lvnU.jpeg

Regression Defect

This enhancement cause a data missing defect in Strategy 2020 when:

  1. A dossier has multiple datasets
  2. At least 2 derived metrics whose metric qualifications have the similar format like Year in XXXX, but the selected element is different. For example, DM1: Cost of Year in 2005; DM2: Cost of Year in 2006

This regression data missing defect is fixed in Strategy 2021 and Strategy 2020 Update 3. To pick up the fix, enable project level setting “Data Engine Version” to 2020 or above.  For more details about this setting, refer to Change Data Engine Version
Detailed reproduce steps:

  1. In Strategy Web, create a new Dossier and click on New Data and select Databases and pick following 2 tables
ka0PW0000001JexYAE_0EM4W000001KHUH.png
  1. Choose Access mode to be "In-Memory"
  2. Add another dataset by clicking New data, choosing databases and picking the following tables
ka0PW0000001JexYAE_0EM4W000001KHUI.png
  1. Define relationships in table LU_DAY
ka0PW0000001JexYAE_0EM4W000001KHUJ.png
  1. Choose Access mode to be "In-Memory" and link attribute Call Ctr Id in two Datasets
  2. Create Derived metrics in the first dataset:
    1. Cost2005: Sum(Tot Cost)<Year Id in 2005>{~+}
    2. Cost2006: Sum(Tot Cost)<Year Id in 2006>{~+}
  3. Add into template: Region Id, Cost2005, Cost2006, add into filter: Call Ctr Id in {1,2,3}
  4. Check the dossier, notice that Cost2006 returns NULL
ka0PW0000001JexYAE_0EM4W000001KHUK.png

After the fix in Strategy 2021 with Data Engine Version  2020, the data is going back to Strategy 2019.

ka0PW0000001JexYAE_0EM4W000001KHUL.png

Strategy Internal Reference number for this technical note is KB483601 and US128767.


Comment

0 comments

Details

Knowledge Article

Published:

September 10, 2019

Last Updated:

March 21, 2024