What is the difference between a CDS association and a join? When does the join actually happen, and what is a path expression?
Say your answer out loud first.
Practise another way
An association declares a relationship to another entity with an ON condition and a cardinality, but nothing runs at definition time. A path expression such as _Customer.Name uses it, and only then does the system build a join.
After FROM that join is inner, anywhere else it is a left outer join. An explicit join is always executed. So I use associations for optional lookups and navigation, and joins when the data must be there.
Definition vs use. association [0..1] to ZI_Customer as _Customer on _Customer.CustomerID = $projection.CustomerID only declares the relationship.
SAP's documentation is explicit that a join is built for every use in a path expression, not for the definition, and no joins are built for associations that are not used.
Join type is decided by position
- Path expression after
FROM(in ABAP SQL or CDS): inner join. - Anywhere else, for example the select list: left outer join.
- ABAP SQL can override this per path segment, for example with an
INNERorLEFT OUTERattribute, together with a cardinality.
Exposure. Listing _Customer in the select list publishes the association without a join. Other CDS views and ABAP SQL can then navigate through it, and Fiori elements uses it for value helps and navigation.
define view entity ZI_Order
as select from zorder
association [0..1] to ZI_Customer as _Customer
on _Customer.CustomerID = $projection.CustomerID
{
key OrderID,
CustomerID,
_Customer.Name as CustomerName, // left outer join built here
_Customer // exposed, no join
}
Join or association?
- Association: lookups and navigation that not every consumer needs. A consumer that does not read
CustomerNamedoes not pay for the join (the optimizer can prune it for to-one targets). - Join: when the other side must exist (inner semantics), or when you aggregate or combine sources in one result set. An inner join is executed even when none of its fields is read.
Rules to remember
- Target fields in the ON condition carry the association prefix; source fields can use
$projection. - A path expression through a to-many association in the select list multiplies rows. See the cardinality scenario card.
- Filters can be put into the path:
_Text[Language = 'E'].Description.
Separates declaring from using, states the inner-after-FROM and left-outer-elsewhere defaults, and gives a rule of thumb for association versus join backed by pruning.
Says associations are 'just joins with nicer syntax' or that the join happens when the view is activated.
Saying an association is a join. Without a path expression no join exists, and the cardinality you declare decides what the optimizer may skip.
- What is exposed in the select list and why does it matter?
- How can a path expression use an inner join in ABAP SQL?
- What does $projection mean in an ON condition?
- Why can an unused association still matter for performance?
3 official pages and 2 prep guides. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.
- Prep guide Gives the question.