INV_FLAT_HIERARCHIES or INV_HIERARCHIES which one to use?
INV_HIERARCHIES is described
This table stores hierarchical relationship information between investments.
It maps the parent to child relationships and also indicates
what percentage of a child investment is allocated.
INV_FLAT_HIERARCHIES is describedThis denormalized table stores data based on INV_HIERARCHIES.
The flattened table contains parent_id and child_id entries
for all descendants of a given investment parent_id that has a hierarchy.
The link_source_id contains the ID of the immediate parent of the child.
This table enables rapid retrieval of all descendants within a hierarchy.
By examining the link_source_id, the original hierarchical order can also be retrieved.
Does parent to child relationships mean just the immediate parent child relationship
or does it mean also further generations? If so, is that explained somewhere?
Like with OBS I have not used the flat tables, but the real relationship tables in queries
and build whatever is needed in spite of the orphans. See
For which versions does
/*This query is a derived version of INV_FLAT_HIERARCHIES as the OOTB table
has a bug with the column LINK_SOURCE_ID
where it doesn't refer to immediate parent...