1
I am attempting to improve performance on a highly normalized database wherein I have the following structure.
entity (identity)
org (identity)
entity-org relation (many to many)
org-entity-owner-relation (many to many + column-informed state)
vuln (identity)
entity-vuln (identity-identity relation 1)
My issue is with the 3-way identity relationship wherein the relationship between entity-vuln relation intersection becomes a subquery of relation between the unrelated org-to-vuln relationship.
If there is an intersection between entity and vuln and there is a relationship between entity and org then I need to be able to show a list and count of org-entity-vuln relation and org-vuln-entity relation. My issue is with sorting and re-indexing.
Is there a way to leverage the database for this effectively or must I do my set operations locally in code?