Skip to content

Conversation

@scv1702
Copy link
Member

@scv1702 scv1702 commented Nov 11, 2024

✨ 구현한 기능

  • 프로젝트 테이블 인덱스 설계를 위한 배치 프로그램 작성
  • 현재 JPA 엔티티에서 @Id@GeneratedValue(strategy = GenerationType.IDENTITY)이기 때문에 EntityManager를 사용해서 배치 INSERT가 불가능해요. 그래서 JdbcTemplate를 사용해서 배치 처리를 진행했으나, 100,000건의 데이터를 처리하려니 속도가 너무 느렸어요. 그래서 CompletableFuture를 사용해 병렬 처리를 진행하고, JDBC의 설정에서 rewriteBatchedStatements=true를 하여 기존 속도 74,981 ms에서 2,463 ms로 약 24.34배 개선했어요.

📢 논의하고 싶은 내용

  • 배치 처리를 JdbcTemplate를 사용하다 보니 컴파일 타임에 쿼리 오류를 체크할 수 없다는 것이 문제에요. 그리고 확실히 JPA 엔티티와 EntityManager를 사용하는 것보다 작성해야 하는 코드가 훨씬 더 많아졌어요.
  • 컴파일 타임에 쿼리 오류를 체크할 수 없는 거에 대하여 이동욱 님의 블로그를 참고해보려고 해요.

🎸 기타

@github-actions
Copy link

github-actions bot commented Nov 11, 2024

Test Results

154 tests  ±0   154 ✅ ±0   21s ⏱️ +3s
 97 suites ±0     0 💤 ±0 
 97 files   ±0     0 ❌ ±0 

Results for commit 4d10329. ± Comparison against base commit 33b1a3e.

♻️ This comment has been updated with latest results.

Copy link
Member

@wlgns12370 wlgns12370 left a comment

Choose a reason for hiding this comment

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

LGTM!

@scv1702 scv1702 merged commit cb99a51 into develop Nov 13, 2024
2 checks passed
@scv1702 scv1702 deleted the feature/GETP-324 branch November 13, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants