Search

fetch_size vs batch_size

hibernate.jdbc.fetch_size

> In the first case, hibernate.jdbc.fetch_size sets the statement's fetch size within the JDBC driver, that is the number of rows fetched when there is more than a one row result on select statements. In the second case, hibernate.jdbc.batch_size determines the number of updates (inserts, updates and deletes) that are sent to the database at one time for execution.
fetch_size 는 result 가 여러개일 때, 한 번에 읽어올 row 수이다(단,MySQL은 항상 전체 데이터를 한방에 읽는다고함. TBD)

hibernate.jdbc.batch_size

batch_size 는 update(insert,update,delete) 시에 묶어서 요청할 갯수이다.
이 때 sequence 기반으로 ID를 생성한다면, sequence 의 increment_size 도 동일하게 맞춰주는게 좋다.
출처: