21:15Runtime IntermediateLevel Jan 2026Last updated
Two objects, one query. This lesson is the difference between walking up a relationship, which is free, and walking down it, which is not — and the rewrite that turns the second into the first.
00:12
A lookup field does not store the record. It stores an id, and the platform knows what that id points at — which is why you can walk it in a query instead of running a second one.
03:02
Dot notation goes up. Contact.Account.Name is one query, not two, and it is five levels deep before the platform stops you.
08:03
Going down is a subquery, and it is a different shape: you get the parent rows back with a list of children hanging off each one.
14:05
Here is the part that bites. The child rows count against the same 50,000, and they count whether or not you look at them.
18:10
So we take the query from the top of the lesson and turn it inside out — same answer, a tenth of the rows.