-
Notifications
You must be signed in to change notification settings - Fork 1
perf: 경매장 거래 내역 검색 아이템명 완전 일치 여부 요청 파리미터 추가 및 인덱스 개선 #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,11 @@ private BooleanBuilder buildItemPredicate( | |
| builder.and(ar.itemSubCategory.eq(c.itemSubCategory())); | ||
| } | ||
| if (c.itemName() != null && !c.itemName().isBlank()) { | ||
| builder.and(ar.itemName.containsIgnoreCase(c.itemName())); | ||
| if (Boolean.TRUE.equals(c.isExactItemName())) { | ||
| builder.and(ar.itemName.eq(c.itemName())); | ||
| } else { | ||
| builder.and(ar.itemName.containsIgnoreCase(c.itemName())); | ||
| } | ||
|
Comment on lines
+112
to
+116
|
||
| } | ||
|
|
||
| if (c.priceSearchRequest() != null) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||
| -- Optimize auction history search indexes for fixed filters: | ||||||
| -- item_top_category, item_sub_category, date_auction_buy | ||||||
|
|
||||||
| -- Replace legacy index that does not align with date-range + date sort pattern | ||||||
| DROP INDEX idx_top_sub_item ON auction_history; | ||||||
|
|
||||||
| -- Main search index: | ||||||
| -- 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); | ||||||
|
||||||
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
isExactItemNameparameter 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 whenisExactItemNameis true vs false vs null.Consider adding test cases that verify:
isExactItemName=true, only exact matches are returnedisExactItemName=falseor null, partial matches (LIKE) are returned