Files
awx/awx/main/models
Dirk Julich fd1745a375 [AAP-78392] Optimize HostManager.active_count() with cache and functional index
active_count() runs a full sequential scan with LOWER()+DISTINCT on main_host for every license check. At customer scale this consumed 74.5 minutes of DB time over 4 hours (47K calls at 93ms avg).

Add a 60-second Redis-backed cache via the existing memoize decorator to reduce call volume by ~99.5%. Add a functional btree index on LOWER(name) to eliminate the sequential scan for the remaining calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-16 18:47:00 +02:00
..
2022-09-22 16:08:22 -04:00