Replaced application-level logic with single SQL query using CASE statement to determine assignment source directly in the database. Before: Loaded all equipment, called get_effective_agent_token_with_source for each (500 equipment = 500+ queries) After: Single query with CASE statement to classify assignment source Performance improvement: Reduces from O(n) queries to 1 query regardless of equipment count. |
||
|---|---|---|
| .. | ||
| towerops | ||
| towerops_web | ||
| towerops.ex | ||
| towerops_web.ex | ||