Corin Fletcher
Corin Fletcher

Reputation: 1661

MySQL prepared statement server caching and HikariCP

I'd like to use prepared statement caching. My application currently uses HikariCP and MySQL 5.6.

HikariCP doesn't do prepared statement caching and suggests that is better done by the database server (argument). However the Hikari MySQL configuration documentation says that the MySQL driver "useServerPrepStmts" option is no longer recommended due to MySQL stability issues. It appears this advice was added in March 2015.

My intrepretation is there is a problem with prepared statements in the MySQL server (as opposed to the MySQL driver or HikariCP/driver interaction problems) but I can't find other mention of problems apart from in the slides referenced in the above documentation (they mention support is "Sketchy on early versions of MySQL-5.0").

Does anybody have any other information? Is there a version of MySQL considered stable?

Upvotes: 2

Views: 599

Answers (1)

brettw
brettw

Reputation: 11114

Sorry for the delayed response. You can still use MySQL prepared statement caching, just as effectively as other pools which perform client-side caching. Reportedly these performance settings work well.

I would say feel free to use useServerPrepStmts, but disable it if you see any strange behavior. There have been a number of issues, and some still remain, but it seems to be getting better.

Upvotes: 2

Related Questions