High-Performance Java Persistence Newsletter, Issue 9

Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?

Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.

So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!


Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java.


The pick of this edition is this article published on the Datadog technical blog showing how you can make a PostgreSQL query run 100 times faster by using the VALUES instead of ARRAY with the ANY expression.

If you are using JPA and Hibernate, there’s a very good chance that you need to store Date and Timestamp values. Having so many options on the Java side makes it difficult to choose the right option. For this reason, I wrote the following guide to help you make the right choice.

If you’re using PostgreSQL, then you should know that prepared statements are emulated by default. Only if you are running the same prepared statement more than 5 times will PostgreSQL compile the statement and use a generic plan for it. Unlike Oracle, PostgreSQL does not use adaptive cursor sharing, so the generic plan might not be suitable when using skew data. For more details about this topic, you should check this very good article written by Franck Pachot.

If you’re using MySQL, then you might want to check the following two articles published on the Percona’s blog about removing bottlenecks caused by high traffic:

Another very good article about MySQL is this one, which explains what makes MySQL LRU cache scan resistant.

The one-to-many table relationship is the most common association type. When using JPA and Hibernate, the @ManyToOne annotation allows you to map the one-to-many table relationship. If you want to see what is the best way to use the @ManyToOne annotation, check out this article.

Funny, yet useful!

It all started as a joke on Twitter:

And, Maciej Walkowiak took it further and wrote a tool to search through articles using the command line:

The background music is worthy of an Oscar.

Project releases

The 8.0.20 version of MySQL has been released. According to the new versioning scheme, this is not a patch release. In fact, it’s not even a minor release, as the latest versions have brought support for many useful features. The most noteworthy feature offered by the 8.0.20 version is Binary Log Compression. For more details about this release, check out the release notes as well.

There were two releases for the Hibernate ORM project:

I released the 2.9.9 version of the Hibernate Types project, which provides several improvements for Array Types.

The Hibernate Types has now reached over 400k monthly downloads:

So, if you are not using it already, you should definitely check it out.

Get in touch with my latest articles!

StackOverflow Answers

The following StackOverflow answers have been trending over the past two weeks:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.