-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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.
@9898s 1차 리뷰 완! 리뷰 남깁니다! 고생많으셨어요. 덕분에 많이 배워요!!
...main/java/com/locationbasedfoodieservice/rawrestaurant/scheduler/RawRestaurantScheduler.java
Show resolved
Hide resolved
jdbcTemplate.batchUpdate(sql, | ||
rawRestaurants, | ||
rawRestaurants.size(), | ||
(PreparedStatement ps, RawRestaurant rawRestaurant) -> { |
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.
덕분에 좋은 거 알아가요..!
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.
PreparedStatement 를 사용하면 장점이 여러개 있군요 !
- 가독성과 유지보수
- 쿼리 실행계획 재사용으로 parse과정을 최초로 한 번만 수행 이후 캐싱
- SQL 인잭션 취약점 보안
@Table(uniqueConstraints = | ||
{@UniqueConstraint(columnNames = {"bizplcNm", "refineZipCd"})}) |
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.
어차피 Restaurant에서 유일키가 있으니까 이 부분은 UK를 걸어주지 않아도 됐었겠네요! 좋아요!
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.
@9898s 수고하셨습니다 !
jdbcTemplate.batchUpdate(sql, | ||
rawRestaurants, | ||
rawRestaurants.size(), | ||
(PreparedStatement ps, RawRestaurant rawRestaurant) -> { |
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.
PreparedStatement 를 사용하면 장점이 여러개 있군요 !
- 가독성과 유지보수
- 쿼리 실행계획 재사용으로 parse과정을 최초로 한 번만 수행 이후 캐싱
- SQL 인잭션 취약점 보안
관련 Issue
변경 사항