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

KB7980: Definition of the 'Where clause driving table’ VLDB property in MicroStrategy Engine


Community Admin

• Strategy


This article covers the purpose of the where clause driving table property

The 'Where clause driving table' Very Large Database (VLDB) property indicates to the Strategy Engine which table to use when a filter needs to be applied. This setting is used as an optimization for some databases which perform better when columns coming from smaller tables are used in the where clause.
By default for all databases, the Strategy Engine applies the filter to the fact table, as seen below:

ka04W000000OhdZQAS_0EM440000002G8O.jpeg

 
Note: This VLDB setting can be set at the Database Instance, Report or Template level .
Given the following example:
 
Metrics:
M1: Sum(Cost) {~+}
 
Template:
[Item], [M1] 
 
Filter:

ka04W000000OhdZQAS_0EM440000002G8M.gif

select pa12. AS QUARTER_ID,
   a13. AS QUARTER_DESC0,
   pa12. AS WJXBFS1,
   pa12. AS WJXBFS2
from pa12,
    a13
where pa12. = a13.
 and (pa12. = 1
 and pa12. = 1)
FilterReferenceEngineSQLApplicationOLAPReport FilterMay reference any object, whether or not it is part of the reportSQL engineGenerated every time there is a change in the filter. It is often part of the WHERE clause of a SQL statementApplied before the generation of the SQL and is then sent to the data warehouseNot an OLAP featureView FilterMay reference only objects that reside in the Report Objects WindowAnalytical Engineno SQL generatedApplied after the data is retrieved from the data warehouseOLAP feature onlyWhere clause driving table = Use fact table (Default)Where clause driving table = Use lookup table

select pa12. AS QUARTER_ID,
   a13. AS QUARTER_DESC0,
   pa12. AS WJXBFS1,
   pa12. AS WJXBFS2
from pa12,
    a13
where pa12. = a13.
 and (pa12. = 1
 and pa12. = 1)
FilterReferenceEngineSQLApplicationOLAPReport FilterMay reference any object, whether or not it is part of the reportSQL engineGenerated every time there is a change in the filter. It is often part of the WHERE clause of a SQL statementApplied before the generation of the SQL and is then sent to the data warehouseNot an OLAP featureView FilterMay reference only objects that reside in the Report Objects WindowAnalytical Engineno SQL generatedApplied after the data is retrieved from the data warehouseOLAP feature onlyWhere clause driving table = Use fact table (Default)Where clause driving table = Use lookup table





select a11.CALL_CTR_ID CALL_CTR_ID,
  max(a12.CENTER_NAME)
CENTER_NAME,
  a11.MONTH_ID MONTH_ID,
  max(a13.MONTH_DESC)
MONTH_DESC,
  sum(a11.TOT_COST) WJXBFS1
from ITEM_MNTH_CTR_SLS a11
  join LU_CALL_CTR a12
    on (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
  join LU_MONTH a13
    on (a11.MONTH_ID = a13.MONTH_ID)
where (a11.MONTH_ID in (200001)
and a12.COUNTRY_ID in (1)
and a11.ITEM_ID in (1))
group by a11.CALL_CTR_ID,
  a11.MONTH_ID

select a12.CALL_CTR_ID CALL_CTR_ID,
  max(a12.CENTER_NAME)
CENTER_NAME,
  a13.MONTH_ID MONTH_ID,
  max(a13.MONTH_DESC)
MONTH_DESC,
  sum(a11.TOT_COST) WJXBFS1
from ITEM_MNTH_CTR_SLS a11
  join LU_CALL_CTR a12
    on (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
  join LU_MONTH a13
    on (a11.MONTH_ID = a13.MONTH_ID)
where (a13.MONTH_ID in (200001)
and a12.COUNTRY_ID in (1)
and a11.ITEM_ID in (1))
group by a12.CALL_CTR_ID,
a13.MONTH_ID
Both reports return the same results, but this report uses the fact table for [MONTH_ID] and [ITEM_ID] and the lookup table for [COUNTRY_ID]. 

Having in mind that the structure of the [ITEM_MNTH_CTR_SLS] table is:



The reasons for this behavior are the following: 

•[ITEM_ID] exists in the fact table and the filter can ONLY be applied to it. 
•[COUNTRY_ID] does NOT exist in the fact table, so ONLY the lookup table can drive this filter. 
•[MONTH_ID] exists in both, the fact and the lookup table in this case the filter is applied to the fact table because the VLDB property says that. This report uses the lookup table for the filters on [MONTH_ID] and [COUNTRY_ID] but still goes to the fact table to apply the filter on [ITEM_ID]. 

The reasons for this behavior are the following: 

•[ITEM_ID] exists in the fact table and it can ONLY be retrieved from it. The setting will NOT force the Strategy Engine to include the [LU_ITEM] table. 
•[COUNTRY_ID] exists in the lookup table and this table is already present in the FROM clause, so it can indeed be extracted from the lookup table. 
•The filter on [MONTH_ID] is applied to the lookup table because the VLDB property dictates so. 



The reasons for this behavior are the following: 

•[ITEM_ID] exists in the fact table and the filter can ONLY be applied to it. 
•[COUNTRY_ID] does NOT exist in the fact table, so ONLY the lookup table can drive this filter. 
•[MONTH_ID] exists in both, the fact and the lookup table in this case the filter is applied to the fact table because the VLDB property says that. This report uses the lookup table for the filters on [MONTH_ID] and [COUNTRY_ID] but still goes to the fact table to apply the filter on [ITEM_ID]. 

The reasons for this behavior are the following: 

•[ITEM_ID] exists in the fact table and it can ONLY be retrieved from it. The setting will NOT force the Strategy Engine to include the [LU_ITEM] table. 
•[COUNTRY_ID] exists in the lookup table and this table is already present in the FROM clause, so it can indeed be extracted from the lookup table. 
•The filter on [MONTH_ID] is applied to the lookup table because the VLDB property dictates so. 

 
In summary, the 'Where clause driving table' VLDB property, will NOT force the Strategy Engine to include tables in the where clause. If the filter cannot be switched to another table, the Strategy Engine will apply the filter to the tables that allow it, overriding in some cases the value of the setting.
 
If it is required to always include the lookup tables to apply the filters on them, then the 'Partial star join' VLDB property needs to be used in conjunction to the 'Where clause driving table'.
 
If this setting is changed on the latter example:

ka04W000000OhdZQAS_0EM440000002G8H.gif

 
The Structured Query Language (SQL) will include the lookup tables and apply the filter on them:
select a12.CALL_CTR_ID CALL_CTR_ID,
  max(a12.CENTER_NAME) CENTER_NAME,
  a14.MONTH_ID MONTH_ID,
  max(a14.MONTH_DESC) MONTH_DESC,
  sum(a11.TOT_COST) WJXBFS1
from ITEM_MNTH_CTR_SLS a11
  join LU_CALL_CTRa12
    on (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
  join LU_ITEM a13
    on (a11.ITEM_ID = a13.ITEM_ID)
  join LU_MONTH a14
    on (a11.MONTH_ID = a14.MONTH_ID)
where (a14.MONTH_ID in (200001)
and a12.COUNTRY_ID in (1)
and a13.ITEM_ID in (1))
group by a12.CALL_CTR_ID,
  a14.MONTH_ID
 
Notice that the SQL is including all the required lookup tables in the FROM clause and the filter is applied to them.


Comment

0 comments

Details

Knowledge Article

Published:

May 5, 2017

Last Updated:

May 5, 2017