cancel
Showing results for 
Search instead for 
Did you mean: 

Why is HANA performance guide saying to avoid SET operations

rajarshi_muhuri
Active Participant
0 Kudos

The section is SAP HANA performance analysis guide suggests avoiding SET operations

https://help.sap.com/viewer/bed8c14f9f024763b0777aa72b5436f6/2.0.03/en-US/a153c5e6d9ac4f3a91b5a6fc26...

SELECT a, b FROM T UNION SELECT a, b FROM S;

could be better as

SELECT DISTINCT COALESCE(T.a, S.a) a, COALESCE(T.b, S.b) b FROM T FULL OUTER JOIN S ON T.a = S.a AND T.b = S.b;

Till date , I always thought that SET operations was better for performance or UNIONS ALL was highly efficient .

Am I understanding wrong ?

The second query using COALESCE and FULL OUTER JOIN seems more intensive operations .

Can any one explain ?

Also EXIST is a co related query . Any tips to alternately frame queries to avoid it ?

SergioG_TX
Active Contributor
0 Kudos

what are you trying to accomplish? are you just needing to do a union of 2 data sets where sometimes you may have null values? there may be many different approaches...

Accepted Solutions (0)

Answers (0)