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

KB38034: What is the effect on the first and subsequent SQL passes of enabling the "Select ID and other forms if they are on template and already available in existing join tree" option in VLDB property


Community Admin

• Strategy


After selecting the setting '"Select ID and other forms if they are on template and already available in existing join tree" for the VLDB property  "Attribute Form Selection Option for Intermediate Pass", located under the "Select / Insert" section, users may note that only the ID form of the attribute is referenced in the first pass of SQL.  Other attribute forms appear only in the second or subsequent passes.

After selecting the setting '"Select ID and other forms if they are on template and already available in existing join tree" for the VLDB property  "Attribute Form Selection Option for Intermediate Pass", located under the "Select / Insert" section, users may note that only the ID form of the attribute is referenced in the first pass of SQL.  Other attribute forms appear only in the second or subsequent passes.
 
STEPS TO REPRODUCE:
 
This issue can be reproduced in the Tutorial project as follows: 

  • Create a report with the Month and Subcategory attributes on the rows and the Profit and Last Year's Profit metrics on the columns:
     
ka04W000000OhYUQA0_0EM440000002DWP.jpeg
  • Enable the following VLDB property, available under the 'Select/Insert' menu:
     
ka04W000000OhYUQA0_0EM440000002DWQ.jpeg
  • Note that the first pass of SQL refers only to the ID form of the Month attribute:
     
    insert into ZZMD00
    select a12. AS SUBCAT_ID,
    a11. AS MONTH_ID,
    sum((a11. - a11.)) AS WJXBFS1
    from  a11,
     a12
    where a11. = a12.
    group by a12.,
    a11. 
     
     
  • Subsequent passes include references to the DESC forms of both attributes incorporated in the report definition:
     
    create table ZZMD01 ( 
    SUBCAT_ID SHORT,
    MONTH_ID LONG,
    MONTH_DESC0            TEXT(50), WJXBFS1 DOUBLE) 
    insert into ZZMD01

    select a13. AS SUBCAT_ID,
    a12. AS MONTH_ID,
    max(a12.) AS MONTH_DESC0,
    sum((a11. - a11.)) AS WJXBFS1
    from  a11,
     a12,
     a13
    where a11. = a12. and
    a11. = a13.
    group by a13.,
    a12.
     
    select pa11. AS MONTH_ID,
    pa12. AS MONTH_DESC0,
    pa11. AS SUBCAT_ID,
    a13. AS SUBCAT_DESC0,pa11. AS WJXBFS1,
    pa12. AS WJXBFS2
    from pa11,
    pa12,
    a13
    where pa11. = pa12. and
    pa11. = pa12. and
    pa11. = a13. 
     

EXPLANATION: 
This behaviour is by design. As implied by the description of the option under the VLDB property, “Select ID and other forms if they are on template and already available in existing join tree”, enabling this will not result in the SQL Engine changing the join tree.  This means that there will be no joins to additional tables to fetch forms other than the ID.
 
Taking the report in Tutorial as an example, in the first temporary table, it is only necessary to join the tables “” and “” to obtain values for the "Profit" metric.  As a direct consequence of this, no other form appearing on the template other than the ID one is fetched.  However, for the other metric, “Last Year’s Profit”, access to the table “LU_Month” is also required in order to calculate the transformation.  The Month DESC form is obtained from it, but the Subcategory DESC form is still missing, so LU_SUBCATEG is joined in the final pass.
  
The principle purpose of the VLDB property in question is to improve performance. This makes it possible to fetch the DESC form, which is available in the join tree in the temporary table, so that it is not necessary to obtain it in the final pass.
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

May 16, 2017

Last Updated:

May 16, 2017