Skip to content

Simplify subdivision SQL requests. #114

@arcadmlafon

Description

@arcadmlafon

Depending on the selected items, the subdivisions SQL request generated use a final join which is not required:

with recursive r_2(id) as (
  select ? as id
   union 
  select rl.PWG_PARENT_ID as id from PROCESS_WAITINGS rl inner join r_2 on (r_2.id = rl.PWG_WAITFOR_ID) 
  )  
  select distinct 
    l_1_0.PRM_ID as id , 
    l_1_0.PRM_SPM_ID as j_parameter, 
    l_1_0.PRM_SAC_ID as j_action, 
    l_1_0.PRM_VALUE as j_value, 
    l_1_0.PRM_UPDDATE as j_date 
    
    from r_2 JOIN PROCESS_PARMS l_1 ON (l_1.PRM_SAC_ID = r_2.id) and l_1.PRM_DELETED = 0  
         LEFT OUTER JOIN PROCESS_PARMS l_1_0 ON (l_1_0.PRM_ID = l_1.PRM_ID and l_1_0.PRM_DELETED = 0 ) 

  where true 

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions