Skip to content

Comments

perf: 경매장 거래 내역 검색 아이템명 완전 일치 여부 요청 파리미터 추가 및 인덱스 개선#101

Merged
dev-ant merged 4 commits intodevfrom
perf/auction-history-index
Feb 19, 2026
Merged

perf: 경매장 거래 내역 검색 아이템명 완전 일치 여부 요청 파리미터 추가 및 인덱스 개선#101
dev-ant merged 4 commits intodevfrom
perf/auction-history-index

Conversation

@dev-ant
Copy link
Contributor

@dev-ant dev-ant commented Feb 19, 2026

📋 상세 설명

  • 경매장 거래 내역 검색 아이템명 완전 일치 여부 (isExactItemName, Boolean, isRequired=false, defaultValue=false) 추가
    • 다만 프론트엔드에서는 true를 기본값으로 사용하도록 권장할 거임
  • auction_history 테이블에 기존 인덱스 제거
    • top_category, sub_category, item_name, data_auction_buy DESC 인덱스 추가

📊 체크리스트

  • PR 제목이 형식에 맞나요 e.g. feat: PR을 등록한다
  • 코드가 테스트 되었나요
  • 문서는 업데이트 되었나요
  • 불필요한 코드를 제거했나요
  • 이슈와 라벨이 등록되었나요

@dev-ant dev-ant requested a review from Copilot February 19, 2026 03:53
@dev-ant dev-ant self-assigned this Feb 19, 2026
@dev-ant dev-ant added the ✨feature 새로운 기능 추가 label Feb 19, 2026
@github-actions
Copy link

✅ 테스트 결과 for PR

Build: success

🧪 테스트 실행 with Gradle
📈 Coverage: -0.00%

📁 테스트 결과
📁 커버리지 보고서 (HTML)

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../persistence/AuctionHistoryQueryDslRepository.java 0.00% 2 Missing ⚠️
...persistence/AuctionRealtimeQueryDslRepository.java 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances auction history and realtime search functionality by adding an exact item name matching option and optimizing database indexes for better query performance.

Changes:

  • Added isExactItemName parameter to enable exact vs partial (LIKE) item name matching
  • Optimized auction history indexes by replacing idx_top_sub_item with idx_ah_top_sub_name_date and adding idx_ahio_type_history
  • Updated date examples in API documentation to reflect current dates

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
AuctionHistorySearchRequest.java Added isExactItemName Boolean parameter for exact match option
AuctionRealtimeSearchRequest.java Added isExactItemName Boolean parameter for exact match option
AuctionHistoryQueryDslRepository.java Implemented conditional logic for exact vs LIKE search based on new parameter
AuctionRealtimeQueryDslRepository.java Implemented conditional logic for exact vs LIKE search based on new parameter
V20__optimize_auction_history_search_indexes.sql Replaced legacy index with optimized multi-column indexes
DateAuctionBuyRequest.java Updated example dates to February 2026
AuctionHistoryServiceTest.java Updated test to include new parameter in record construction
ItemInfoServiceTest.java Code formatting improvements (line break adjustments)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

-- Equality filters first, range/sort column last
-- date_auction_buy는 where 조건에 무조건 포함 및 높은 확률로 정렬 조건
CREATE INDEX idx_ah_top_sub_name_date
ON auction_history (item_top_category, item_sub_category, item_name, date_auction_buy DESC);
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index includes item_name as an equality filter column, but the query logic uses containsIgnoreCase (LIKE search) when isExactItemName is false or null. This means the index may not be effective for the common case of LIKE searches.

Consider either:

  1. Creating separate indexes for exact vs LIKE searches
  2. Moving item_name after date_auction_buy in the index so it doesn't break the index effectiveness for range/sort operations
  3. Adding a covering index without item_name for LIKE searches

The current index will only be fully effective when isExactItemName=true, but may have reduced effectiveness for LIKE searches since MySQL/PostgreSQL cannot use the full index when a prefix column uses LIKE patterns.

Suggested change
ON auction_history (item_top_category, item_sub_category, item_name, date_auction_buy DESC);
ON auction_history (item_top_category, item_sub_category, date_auction_buy DESC, item_name);

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +127
if (Boolean.TRUE.equals(c.isExactItemName())) {
builder.and(ah.itemName.eq(c.itemName()));
} else {
builder.and(ah.itemName.containsIgnoreCase(c.itemName()));
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new isExactItemName parameter lacks test coverage. While the test correctly adds a seventh null parameter to match the new record signature, there are no tests verifying the behavior when isExactItemName is true vs false vs null.

Consider adding test cases that verify:

  1. When isExactItemName=true, only exact matches are returned
  2. When isExactItemName=false or null, partial matches (LIKE) are returned
  3. The query correctly handles the parameter in combination with other search criteria

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +116
if (Boolean.TRUE.equals(c.isExactItemName())) {
builder.and(ar.itemName.eq(c.itemName()));
} else {
builder.and(ar.itemName.containsIgnoreCase(c.itemName()));
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new isExactItemName parameter lacks test coverage. There are no tests verifying the behavior when isExactItemName is true vs false vs null.

Consider adding test cases that verify:

  1. When isExactItemName=true, only exact matches are returned
  2. When isExactItemName=false or null, partial matches (LIKE) are returned
  3. The query correctly handles the parameter in combination with other search criteria

Copilot uses AI. Check for mistakes.
@dev-ant dev-ant merged commit e1b8810 into dev Feb 19, 2026
7 of 8 checks passed
@dev-ant dev-ant deleted the perf/auction-history-index branch February 19, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant