The prepareThreshold
in pgjdbc have the following definition:
Determine the number of PreparedStatement executions required before switching over to use server side prepared statements. The default is five, meaning start using server side prepared statements on the fifth execution of the same PreparedStatement object. More information on server side prepared statements is available in the section called “Server Prepared Statements”.
I wonder what benefit this actually brings us? Most webservers aren't restarted for months, so all database queries will be sent more than 5 times eventually, so give it a week or so and all prepared statements will be stored at the server, won't them? Is this only for benefiting desktop applications? Or am I missing something, like a "5 threshold over a period of time"?