[REGRESSION FROM NETEZZA]
By default, a UDTF written in CPP is registered in DISALLOW PARALLEL mode using the IDA DEPLOYUDX command. As a result, the UDTF is invoked on a single partition only on an MPP system. This is a serious performance bottleneck for any unit of work involving a UDTF. There is no setting to change this behavior. While this may be an enhancement for Db2, it is a serious regression for all applications and customers migrating from Netezza. Please accept and expedite ALLOW PARALLEL for UDTF written in CPP.
--- Example invocation ---
SELECT a.GroupID AS GroupID, a.val_ID as pValID,
a.val_type as pValType, a.num_val as pNumVal,
NVL(LAG(0) OVER (PARTITION BY a.GroupID order by val_type), 1) AS Begin_flag,
NVL(LEAD(0) OVER (PARTITION BY a.GroupID order by val_type), 1) AS End_flag
FROM tblBSplineBasisTestMD a
) AS z,
TABLE (FLBSplineBasisUdt(z.GroupID, z.pValType, z.pNumVal, 3,
z.pValID)) AS a
ORDER BY 1, 2, 3 ;
--- Engineering notes from IBM ---
1. Db2 does not guarantee partition function invocation association and neither guarantees the 'order by' of the sub-query be honored for the table function invocation. The expert's opinion is if we see such behavior sometimes, it is plain luck and we should not rely on such behavior in our design.
2. All records of a partition should go to a single instance of the UDTF.
3. The records within the partition should be passed in the same order to the UDTF as given in the order by clause of the partition.
4. Currently, the above cannot be enforced and optimizer experts say parallel processing could destroy the order in which the subquery feeds the UDTF. No rewrites are available to make it work.
5. Further, the reason we get the partition records in order currently is because lead/lag functions used in the FL query are not pushed down to CDE. As a result, the correlation b/w the subquery and UDTF happens via a row TQ which maintains the order. However, if lead/lag functions get pushed down to CDE, the optimizer team believes this behavior may change. Also the optimizer team will not document this behavior as it is not mandated by SQL standard. In the long term, we have to explore other options considering this behavior could change and also solve the problem of UDTF logic running only on one node.
6. If this feature is accepted as an enhancement, FL advises to implement in a different (more appropriate) way – by adding a PARTITION BY and LOCAL ORDER BY clauses to the UDT invocation itself (not through a sub-query).
|Who would benefit from this IDEA?||All Customers migrating from Netezza|
How should it work?
1. If this feature is accepted as an enhancement, FL advises to implement in a different (more appropriate) way – by adding a PARTITION BY and LOCAL ORDER BY clauses to the UDT invocation itself (not through a sub-query).
2. Please find attached a technical document outlining proper UDT call and table operator consideration.
|Priority Justification||Urgent because All Customers migrating from Netezza would be impacted immediately.|
|Client Name||Fuzzy Logix|
|IBM's success depends on gathering feedback from customers like yourself. Aha Ideas Portal is the third party tool through which IBM Offering Managers gather feedback from customers such as yourself.|
|IBM is a global organization with business processes, management structures, technical systems and service provider networks that cross borders. As such, the information collected through Aha Ideas Portal (Customer Name, Customer Email Address) will be stored by them in the United States, and handled only as per IBM's instructions and policies. Your data (Name and Email Address) will NOT be shared with other IBM customers.|
|In order to safeguard your information in Aha, do not leave your workstation unattended while using this application, log off after using it, and print only if necessary. If you need to make a hardcopy, remember to pick up the print-out immediately, keep it under lock, and destroy it immediately when no longer needed.|
|NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "email@example.com" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions|