Description:
Prepared statements are currently cached only at the session level. In the context of a stateless web application (think PHP web app), this makes the current system pretty much useless (even considering persistent connections as they have a fairly limited lifetime).
Such a web application should still be able to benefit from the security advantage of prepared statement without incurring the cost of having to prepare a query almost every time. The cost being at least 2 more network round-trip to prepare the statement and the tiny performance hit of caching it at the session level.
How to repeat:
This is a new feature request.
Suggested fix:
It would be very useful to have the ability to globally cache prepared statement and set a cache size limit, either by memory of number of cached prepared statement.