Skip to content

Files

Latest commit

 

History

History

HibernateSpringBootINListPadding

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

IN Clause Parameter Padding

Description: This application is an example of using Hibernate IN cluase parameter padding. This way we can reduce the number of Execution Plans. Mainly, Hibernate is padding parameters as follows:

  • for 3 and 4 parameters -> it uses 4 bind parameters (2^2)
  • for 5, 6, 7 and 8 parameters -> it uses 8 bind parameters (2^3)
  • for 9, 10, 11, 12, 13, 14, 15 and 16 parameters -> it uses 16 parameters (2^4)
  • ...

Key points:

  • in application.properties set spring.jpa.properties.hibernate.query.in_clause_parameter_padding=true

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.