这些缓存 HikariCP 数据源属性是什么

What are these cache HikariCP datasource properties

HikariCP 的 documentation 提供了这些属性,即 cachePrepStmtsprepStmtCacheSizeprepStmtCacheSqlLimit. 但我无法在任何地方找到它们的确切含义以及最后两个属性的单位是什么。它们的名字暗示它们与缓存和准备语句有关,但我仍然感到困惑。

prepStmtCacheSize到底是什么意思,250的单位是什么?是 KB 还是 MB 还是其他? 完全不知道 prepStmtCacheSqlLimit 是什么意思,2048 的单位是什么?

这是特定的 MySQL Configuration

prepStmtCacheSize This sets the number of prepared statements that the MySQL driver will cache per connection. The default is a conservative 25. We recommend setting this to between 250-500.

prepStmtCacheSqlLimit This is the maximum length of a prepared SQL statement that the driver will cache. The MySQL default is 256. In our experience, especially with ORM frameworks like Hibernate, this default is well below the threshold of generated statement lengths. Our recommended setting is 2048.