대량 삭제
-
Delete 배치 처리 (feat. deleteAllInbatch() vs batchUpdate() + rewriteBatchedStatements=true vs in 절)Spring 2025. 4. 8. 20:58
이전에 bulk insert에 대해서 찾아보았다. ↓https://dodop-blog.tistory.com/498 Spring JPA의 save() vs saveAll() vs bulk insert() (feat. db client)이번에 면허 재검증 프로세스를 구성하면서 면허 검증 로깅에 관한 작업을 구성하게 되었다. 면허 검증에는 배치로 검증하는 과정이 있기 떄문에, 로깅도 한번에 저장되어 DB 팀에게 어느정도dodop-blog.tistory.com 그렇다면 다량의 데이터를 delete 처리할 때는 어떨까? 1. jpa의 delete() 메서드 활용 가장 먼저 for문을 이용해서 delete()메서드를 연속호출하여 인서트를 수행해보자. @Test fun delete() { ..