High-Performance Java Persistence Newsletter, Issue 16

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!

Introduction

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.

Articles

The pick of this edition is this article that explains how you can activate the slow query log in PostgreSQL using either the log_duration setting or the pg_stat_statements extension.

If you want to implement an audit log mechanism using PostgreSQL, then you can use a functional trigger to intercept INSERT, UPDATE, and DELETE statements and store the state of the row before and after the DML statement is executed in jsonb columns. For more details about this technique, check out this article.

PostgreSQL provides a great variety of column types, and for store date and time info, you can use date, time, timestamp, tsrange, or daterange. If you want to get a better understanding of all these types, then you should definitely read this article.

Sometimes, the default PostgreSQL statistics might not be suitable for all types of queries, so you need to enable the extended statistics to provide more accurate data value distribution info to the database optimizer. For instance, this article explains how you can optimize a certain query so that its execution is reduced from 2 minutes to 42 milliseconds.

SQL provides many operators, that, unfortunately, are either not known very well or not employed. For example, the ANY operator allows you to match a given value against a list of values resulting from a subquery execution or from a VALUES clause. If you are interested in getting a better understanding of how the ANY operator works, then check out this article.

Project Releases

The 5.4.21 version of Hibernate ORM has been released. For more details about this release, check out the release notes on Jira.

Best Tweets

There are many social media platforms, but for me, Twitter is the one I like best. Here are the best tweets I posted since the last newsletter:

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.