Recently, I stumbled on the following Twitter thread:
A lesser known jOOQ feature that developers don't know about, but DBAs will rejoice!— jOOQ (@JavaOOQ) April 11, 2018
Automatic IN-list padding (to prevent contention on execution plan caches / too many hard parses)https://t.co/CNa7kd5rAr
This jOOQ feature is indeed really useful since it reduces the number of SQL statements that have to be generated when varying the IN clause parameters dynamically.
Starting with Hibernate ORM 5.2.18, it’s now possible to use IN clause parameter padding so that you can improve SQL Statement Caching efficiency.
In this article, I’m going to explain how this new mechanism works and why you should definitely consider it when using a relational database system which supports Execution Plan caching.