Skip to content

[refactor] TrackingPointFlushService JDBC batch insert 전환 #277

Description

@howooyeon

📖 작업 개요

  • TrackingPointFlushServicesaveAll()GenerationType.IDENTITY 때문에 건건이 INSERT되는 문제를 JDBC batch insert로 전환하여 DB 왕복 횟수를 줄임

🧩 작업 내용

  • TrackingPointRepository에 네이티브 멀티 row INSERT 쿼리 또는 JdbcTemplate.batchUpdate() 기반 bulk insert 메서드 추가
  • TrackingPointFlushService.flush()에서 saveAll() → bulk insert 호출로 교체
  • 배치 사이즈 설정 및 PostGIS Point 타입 바인딩 처리

📱 관련 화면 / 기능

  • 기타: 실시간 GPS 트래킹 (포인트 DB 저장)

💬 기타 사항

  • 현재 100건 flush 시 INSERT 100회 왕복 → batch insert로 1회로 줄일 수 있음
  • GenerationType.IDENTITY는 Hibernate batch를 비활성화하므로, JPA가 아닌 JDBC 레벨에서 처리해야 함
  • 저장 후 ID를 다시 읽을 필요가 없으므로 IDENTITY 전략은 그대로 유지 가능

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions