Hi Deena,
Refer the below link for retrieve from database vs by association
As usual, it depends. In general, by association is faster when the object was already in memory, but:
- if you had your object on a page or in a subflow with uncommitted changes you’ll have to retrieve by association or you lose the changes
- if you have a lot of associated objects, it’s better to retrieve by xpath and constrain instead of handling huge lists
There may be other things to consider, but that’s my 2 cents.