Repository navigation
Commit 38620a2
perf(database): index entity_relations.relation_id for inbound graph traversal (#194)
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 ms
Co-authored-by: Andrés Brand <andres.brand.partner@decathlon.com>1 parent 6bbce97 commit 38620a2
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