Conversation
✅ 테스트 결과 for PRBuild: success 🧪 테스트 실행 with Gradle |
There was a problem hiding this comment.
Pull request overview
This PR introduces a dedicated Redis cache for auction history count queries, separating the count from the search results to avoid redundant database count queries across different pages of the same search. It also adds a new database index to optimize category+date range queries, and refactors the repository layer to split the previous search method (returning Page) into searchContent (returning List) and count (returning long).
Changes:
- Splits the auction history repository
search(Page)method intosearchContent(List)andcount(long), enabling independent caching of count results via a newauction-history:countRedis cache - Adds a new database index (
idx_ah_top_sub_date) on(item_top_category, item_sub_category, date_auction_buy DESC)to optimize count/search queries withoutitem_namefilters - Enables P6Spy SQL logging in
application.yml(changed fromfalsetotrue)
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
AuctionHistoryService.java |
Adds manual count cache lookup/put via CacheManager, with resolveTotalCount and isCountCacheEligible methods |
AuctionHistoryQueryDslRepository.java |
Splits search into searchContent and count; extracts buildSearchPredicate as shared predicate builder |
AuctionHistoryRepositoryPort.java |
Updates port interface: replaces search(Page) with searchContent(List) and count(long) |
AuctionHistoryRepositoryPortImpl.java |
Updates port implementation to delegate to new QueryDsl methods |
CacheNames.java |
Adds AUCTION_HISTORY_COUNT constant |
RedisConfig.java |
Registers the new count cache with 2-hour TTL |
CacheKeyBuilder.java |
Adds buildAuctionHistoryCountKey and extracts resolveAuctionHistoryDateRange helper |
AuctionHistoryCacheWarmupService.java |
Evicts the new count cache alongside the search cache |
V27__add_auction_history_category_date_index.sql |
Adds database index for category+date queries |
application.yml |
Enables P6Spy logging |
AuctionHistoryServiceTest.java |
Updates test mocks to match new split API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| private void evictCaches() { | ||
| clearCache(CacheNames.AUCTION_HISTORY_SEARCH); | ||
| clearCache(CacheNames.AUCTION_HISTORY_COUNT); |
There was a problem hiding this comment.
The class Javadoc on line 20 lists only auction-history:search as being evicted, but the evictCaches() method now also evicts auction-history:count. The documentation should be updated to mention both caches to avoid confusion.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📋 상세 설명
📊 체크리스트
이슈 미등록