perf(account): 내역 목록 태그 조회 N+1 → 배치 단일 쿼리로 개선

list() 에서 항목마다 findTagNamesByEntryId() 를 개별 호출하던 N+1 을
findTagsByEntryIds() 배치 쿼리 1회로 대체.
항목 수가 많을 때 타임아웃/과부하 방지.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-07-02 01:47:08 +09:00
co-authored by Claude Sonnet 4.6
parent 947c7a1f68
commit 190fbe835f
3 changed files with 28 additions and 3 deletions
@@ -93,4 +93,7 @@ public interface AccountEntryMapper {
int deleteEntryTagsByEntryId(@Param("entryId") Long entryId);
List<String> findTagNamesByEntryId(@Param("entryId") Long entryId);
/** 복수 항목의 태그를 한 번에 조회 — {entryId, tagName} 맵 반환 */
List<Map<String, Object>> findTagsByEntryIds(@Param("entryIds") List<Long> entryIds);
}