Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Query on joins

$
0
0

Hi Sumeet,

 

referential joins are meant to provide an additional option for run time shortening under very specific conditions.

 

If you think about when it could be possible to not touch the second table for a join and still yield the correct result, then this is only the case for

  • inner joins
  • where there actually is one and only one matching record in the second table
  • when no columns from the second table are requested

 

For other cardinalities, like 1..0 and 1..n, the database has to go and look up how many records are actually matching. So, there's no benefit here.

 

For outer joins only the cardinality 1..0/1 would allow not touching the second table, as every record in the starting table would yield exactly one record in the result set.

 

Whenever any of these prerequisites is not fulfilled, the second table must be touched, even if no columns from it are requested.

 

Since I don't know how you join the tables and how the cardinalities are set, there's not much more I can tell here.

 

You may want to go and check the "Validate Join" functionality (right click on the join) to get advise on the join type and the cardinality.

 

- Lars


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>