Skip to content

Conversation

@Dockerel
Copy link
Contributor

@Dockerel Dockerel commented Sep 5, 2025

#️⃣ 연관된 이슈

📚 배경

띱 요청 거리순 조회가 현재 비효율적인 유클리안 거리 방식으로 구현되어 있어 개선이 필요하였습니다.

https://han5ung.tistory.com/29
https://youngwoon.tistory.com/m/11

위 자료들을 참고하였습니다.

📝 작업 내용

  • 띱 요청 거리순 조회를 공간 인덱싱 방식으로 개선하였습니다.
  • 데이터베이스 스키마 재생성 시 공간 인덱스 쿼리 실행이 필요합니다.
  • 두 좌표(위도, 경도) 기반 거리 측정 방식인 하버사인 방식을 도입하였습니다.
  • 화면 내의 가장 먼 좌표를
image
  • 위 사진에서 가장 긴 거리 기반으로 해당 거리를 반지름, 유저의 좌표를 중심으로 하는 원을 만들어 해당 반경 내에 요청들을 가져오는 방식입니다.
  • 공간 인덱스 도입 + 배치 사이즈 설정으로 약 1600ms → 160ms 내외로 약 10배 개선되었습니다.

📸 스크린샷

x

💬 리뷰 요구사항

x

✏ Git Close

close #31

@Dockerel Dockerel requested a review from GitJIHO September 5, 2025 12:20
@Dockerel Dockerel self-assigned this Sep 5, 2025
@Dockerel Dockerel added the ♻️ Refactoring 코드 리팩토링 & 클린 코드 작업을 진행하는 경우 label Sep 5, 2025
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

📊 Code Coverage Report

Overall Project 75.57% 🍏
Files changed 100% 🍏

File Coverage
DdipEventRepositoryImpl.java 100% 🍏
DistanceConverter.java 100% 🍏
DdipService.java 100% 🍏
DdipMapper.java 100% 🍏

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

Test Results

207 tests   207 ✅  7s ⏱️
 36 suites    0 💤
 36 files      0 ❌

Results for commit a22b0c8.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@GitJIHO GitJIHO left a comment

Choose a reason for hiding this comment

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

대면으로 코드리뷰 및 의문점 해결 완료하였습니다 👍
고생하셨습니다.
좋은 도입이라고 생각합니다 😄

@Dockerel Dockerel merged commit bd9b395 into main Sep 6, 2025
2 checks passed
@Dockerel Dockerel deleted the Refactor/issue-#31 branch September 6, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ Refactoring 코드 리팩토링 & 클린 코드 작업을 진행하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: 띱 요청 거리순 조회 속도 개선

3 participants