Skip to content
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

[refactor] raw restaurant 데이터 갱신 속도 개선 #37

Merged
merged 2 commits into from
Nov 19, 2023

Conversation

9898s
Copy link
Contributor

@9898s 9898s commented Nov 10, 2023

관련 Issue

변경 사항

  • open api를 통해 가져온 데이터 갱신 속도를 개선시켰습니다. (40분 -> 40초)
스크린샷 2023-11-10 오후 8 56 35 스크린샷 2023-11-10 오후 9 07 00

@9898s 9898s added the refactor refactor label Nov 10, 2023
@9898s 9898s self-assigned this Nov 10, 2023
Copy link

github-actions bot commented Nov 10, 2023

Test Results

9 tests  ±0   9 ✔️ ±0   2s ⏱️ ±0s
4 suites ±0   0 💤 ±0 
4 files   ±0   0 ±0 

Results for commit 2924cb8. ± Comparison against base commit 835be59.

♻️ This comment has been updated with latest results.

@9898s 9898s added wip Work In Progress and removed wip Work In Progress labels Nov 10, 2023
@JisooPyo JisooPyo linked an issue Nov 10, 2023 that may be closed by this pull request
1 task
Copy link
Member

@JisooPyo JisooPyo left a comment

Choose a reason for hiding this comment

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

@9898s 1차 리뷰 완! 리뷰 남깁니다! 고생많으셨어요. 덕분에 많이 배워요!!

Comment on lines +29 to +32
jdbcTemplate.batchUpdate(sql,
rawRestaurants,
rawRestaurants.size(),
(PreparedStatement ps, RawRestaurant rawRestaurant) -> {
Copy link
Member

Choose a reason for hiding this comment

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

덕분에 좋은 거 알아가요..!

Copy link
Member

Choose a reason for hiding this comment

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

PreparedStatement 를 사용하면 장점이 여러개 있군요 !

  • 가독성과 유지보수
  • 쿼리 실행계획 재사용으로 parse과정을 최초로 한 번만 수행 이후 캐싱
  • SQL 인잭션 취약점 보안

Comment on lines -18 to -19
@Table(uniqueConstraints =
{@UniqueConstraint(columnNames = {"bizplcNm", "refineZipCd"})})
Copy link
Member

Choose a reason for hiding this comment

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

어차피 Restaurant에서 유일키가 있으니까 이 부분은 UK를 걸어주지 않아도 됐었겠네요! 좋아요!

Copy link
Member

@rivkode rivkode left a comment

Choose a reason for hiding this comment

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

@9898s 수고하셨습니다 !

Comment on lines +29 to +32
jdbcTemplate.batchUpdate(sql,
rawRestaurants,
rawRestaurants.size(),
(PreparedStatement ps, RawRestaurant rawRestaurant) -> {
Copy link
Member

Choose a reason for hiding this comment

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

PreparedStatement 를 사용하면 장점이 여러개 있군요 !

  • 가독성과 유지보수
  • 쿼리 실행계획 재사용으로 parse과정을 최초로 한 번만 수행 이후 캐싱
  • SQL 인잭션 취약점 보안

@rivkode rivkode merged commit 6c0a6bd into develop Nov 19, 2023
3 checks passed
@rivkode rivkode deleted the refactor/36/raw-restaurant-improve branch November 19, 2023 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refactor] raw restaurant 데이터 갱신 속도 개선하기
3 participants