vladmihalcea / hypersistence-optimizer

Hypersistence Optimizer allows you to get the most out of JPA and Hibernate. By scanning your application configuration and mappings, Hypersistence Optimizer can tell you what changes you need to do to speed up your data access layer.
https://vladmihalcea.com/hypersistence-optimizer/
Apache License 2.0
315 stars 43 forks source link

When using PostgreSQL, check if the statement caching mechanism is enabled #116

Closed vladmihalcea closed 3 years ago

vladmihalcea commented 3 years ago

The PostgreSQL JDBC Driver supports statement caching, which can be configured like this:

PGSimpleDataSource dataSource = (PGSimpleDataSource) super.dataSource();
dataSource.setPreparedStatementCacheQueries(cacheSize);

By enabling statement caching, the transaction response time can be reduced. Therefore, if PostgreSQL is being used, we should check if the statement cache has been enabled.

vladmihalcea commented 3 years ago

Fixed.