문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:hibernate:performance [2019/01/02 13:12] kwon37xi [autoCommit 을 꺼서 성능 향상시키기] |
java:hibernate:performance [2021/09/07 17:27] kwon37xi [autoCommit 을 꺼서 성능 향상시키기] |
||
---|---|---|---|
줄 19: | 줄 19: | ||
하지만 '' | 하지만 '' | ||
- | * '' | + | * '' |
- | * OneToOne Eager 에 대해서는 작동하지 않았다. | + | * OneToOne, ManyToOne |
+ | * 지나치게 큰 값을 설정하지 말아야 한다. 30개 정도가 적당해 보이며, 쿼리 실행시간이 수십 밀리세컨드 이내로 끝날 수준으로 정하는게 좋다. | ||
===== hibernate.jdbc.fetch_size ===== | ===== hibernate.jdbc.fetch_size ===== | ||
* [[https:// | * [[https:// | ||
- | + | > In the first case, hibernate.jdbc.fetch_size sets the statement' | |
- | TBD | + | * '' |
===== hibernate.jdbc.batch_size ===== | ===== hibernate.jdbc.batch_size ===== | ||
- | TBD | + | * [[java: |
+ | * '' | ||
+ | * 이 때 sequence 기반으로 ID를 생성한다면, | ||
+ | ===== hibernate.query.in_clause_parameter_padding=true ===== | ||
+ | * Hibernate 5.2.18 이후 버전 '' | ||
+ | * '' | ||
+ | * [[https:// | ||
+ | * 위 옵션을 켜지 않으면, '' | ||
+ | * 또한 RDBMS 의 경우 그 자체 execution plan cache 가 있는데, 이 옵션을 켜면 그에 대한 hit 율도 높아지게 된다. | ||
+ | ===== Hibernate Query Plan Cache ===== | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | * 별문제 없으면 변경하지 말 것. | ||
===== autoCommit 을 꺼서 성능 향상시키기 ===== | ===== autoCommit 을 꺼서 성능 향상시키기 ===== | ||
* Connection Pool 의 '' | * Connection Pool 의 '' | ||
+ | |||
+ | <note warning> | ||
+ | 아주 많은 Spring의 확장들이 auto commit=true를 가정하고 만들어져 있는 것으로 보인다. | ||
+ | |||
+ | auto commit=false 이면서 Spring Data 사용시 제대로 Transaction이 안 걸려 있으면 오동작이 발생한다. | ||
+ | 모든 Repository 인터페이스와 Custom 구현에 '' | ||
+ | </ | ||
+ | |||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | * DBCP 설정의 '' | + | * 커넥션 풀 설정의 '' |
- | * '' | + | * '' |
+ | * [[springframework: | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | if (!vendorProperties.containsKey(PROVIDER_DISABLES_AUTOCOMMIT)) { | ||
+ | configureProviderDisablesAutocommit(vendorProperties); | ||
+ | } | ||
+ | |||
+ | ... | ||
+ | |||
+ | if (isDataSourceAutoCommitDisabled() && !isJta()) { | ||
+ | vendorProperties.put(PROVIDER_DISABLES_AUTOCOMMIT, | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | > in Hibernate 5.2.10, we introduced the hibernate.connection.provider_disables_autocommit configuration property which tells Hibernate that the underlying JDBC Connections already disabled the auto-commit mode. | ||
줄 57: | 줄 93: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |