Repository navigation
Commit f254544
committed
perf(database): index entity_relations.relation_id for inbound graph traversal
The recursive graph query resolves inbound edges by joining
relation_target_entities to entity_relations on relation_id. entity_relations
only had indexes leading with entity_id, so that join was a sequential scan
per frontier node. The query runs on every entity list page.
Measured on 15k entities / 22k edges (local Docker, 2 CPU):
- list 20 services: p50 263-378 ms -> 87 ms
- property filter: p50 460 ms -> 100 ms
- graph depth 3 bidirectional: p50 64 ms -> 28 ms1 parent 01ee623 commit f254544
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments