Number of active entities query timeouts in peer-eu1 when checking if needed to create a yearly snapshot. The query is scanning through all the deployments table to get the number of active entities (deleter_deployment = null) in the given year time range. The query takes ~3 minutes.
Analyze possible solutions:
- Add index for
entity_timestamp field in deployments.
- Add
entity_timestamp in active_pointers table and add index for it.