Skip to content

fix: 키워드 페이지 네이션 조회 로직 개선#2275

Merged
Soundbar91 merged 2 commits into
developfrom
fix/2270-match-keyword
May 27, 2026
Merged

fix: 키워드 페이지 네이션 조회 로직 개선#2275
Soundbar91 merged 2 commits into
developfrom
fix/2270-match-keyword

Conversation

@Soundbar91
Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 commented May 27, 2026

🔍 개요

Image
  • 현재 ArticleKeyword 테이블에서 데이터를 100개 단위로 배치 조회하고 있음
  • 그러나 데이터 규모가 200개 내외인 현 시점에서는 불필요한 배치 조회로 판단됨
    • 해당 배치 조회 과정에서 총 쿼리 소요 시간은 약 40ms
  • 스테이지 환경 테스트 결과, ArticleKeywordUserMap이 8,100건을 초과하는 시점부터 처리 시간이 증가함을 확인
  • DA에 데이터 증가 추이 예측을 요청한 결과, 8,100건에 도달하는 시점은 2052년 3월경으로 전달받음

→ 따라서 현 시점뿐 아니라 향후 수십 년간 페이징 처리는 불필요하다고 판단됨


🚀 주요 변경 내용

  • ArticleKeyword 페이징 처리를 일괄 조회로 수정했습니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • Refactor
    • Simplified keyword retrieval mechanism by removing pagination logic from the keyword matching system, streamlining how article keywords are fetched and processed.

Review Change Stack

@Soundbar91 Soundbar91 self-assigned this May 27, 2026
@github-actions github-actions Bot added the 공통 백엔드 공통으로 작업할 이슈입니다. label May 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4d73b631-00cf-421b-b314-83781e21e4c6

📥 Commits

Reviewing files that changed from the base of the PR and between 872c03b and 8a90b54.

📒 Files selected for processing (2)
  • src/main/java/in/koreatech/koin/domain/community/keyword/repository/ArticleKeywordRepository.java
  • src/main/java/in/koreatech/koin/domain/community/util/KeywordExtractor.java

📝 Walkthrough

Walkthrough

This PR removes pagination logic from keyword extraction. The ArticleKeywordRepository.findAllByCategory() method signature no longer accepts a Pageable parameter, and KeywordExtractor is refactored to fetch all keywords in a single repository call and iterate through them directly instead of using a batch loop.

Changes

Keyword Retrieval Pagination Removal

Layer / File(s) Summary
Keyword retrieval pagination removal
src/main/java/in/koreatech/koin/domain/community/keyword/repository/ArticleKeywordRepository.java, src/main/java/in/koreatech/koin/domain/community/util/KeywordExtractor.java
ArticleKeywordRepository.findAllByCategory() removes the Pageable parameter; KeywordExtractor.matchKeywords() removes pagination imports and replaces the batch-fetch loop with a single non-paginated repository call that loads all keywords for the category and iterates them directly.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly Related PRs

  • BCSDLab/KOIN_API_V2#2216: Both PRs change KeywordExtractor to stop using pageable/batched keyword retrieval by adjusting ArticleKeywordRepository query methods.
  • BCSDLab/KOIN_API_V2#2217: Both PRs modify how KeywordExtractor retrieves ArticleKeywords via ArticleKeywordRepository by removing or reworking pagination-driven batch loops.

Suggested Labels

성능개선

Suggested Reviewers

  • dh2906
  • kih1015
  • duehee

Poem

🐰 Batch loops begone, one query now reigns,
No pages to fetch, no pagination chains,
For decades to come, the data runs lean,
One simple call gives keywords pristine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: 키워드 페이지 네이션 조회 로직 개선' accurately describes the main change: improving keyword pagination retrieval logic by removing unnecessary batching.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #2270: removes batched/paged keyword retrieval by changing findAllByCategory to accept only KeywordCategory parameter and replacing pagination loop logic with a single bulk fetch.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objective of removing pagination from keyword retrieval; modifications to ArticleKeywordRepository and KeywordExtractor align precisely with the stated goal of simplifying bulk keyword fetching.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2270-match-keyword

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label May 27, 2026
@github-actions github-actions Bot requested review from BaeJinho4028 and DHkimgit May 27, 2026 04:34
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

Unit Test Results

660 tests   657 ✔️  1m 20s ⏱️
163 suites      3 💤
163 files        0

Results for commit 8d024e8.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

@dh2906 dh2906 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@Soundbar91 Soundbar91 merged commit 8d69a31 into develop May 27, 2026
6 checks passed
@Soundbar91 Soundbar91 deleted the fix/2270-match-keyword branch May 27, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

공통 백엔드 공통으로 작업할 이슈입니다. 버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[공통] 키워드 조회 로직 수정

2 participants