If I need to write a child record of a shared root record, what's the best way to determine whether I write it to the private or shared database?
For shared root records, record.share is non-nil. But for child records of that root record, record.share is nil.
I understand that child records have a parent reference that can be resolved to determine whether the parent has a share, but resolving that reference is increasingly expensive the more deeply the child is nested.
Given an arbitrarily deeply nested child record, is there a cheap and canonical way to determine whether the record should be written to the shared database?