Problem
ApplicationBackUpCleanTask performs N+1 queries: one grouped query per app id, then loads all backups per app and deletes them one-by-one with removeById.
Proposed solution
- Load all backups in a single query
- Group and trim in memory per application id
- Delete expired records with one
removeByIds batch call
Problem
ApplicationBackUpCleanTaskperforms N+1 queries: one grouped query per app id, then loads all backups per app and deletes them one-by-one withremoveById.Proposed solution
removeByIdsbatch call