MySQL Connector J and the curse of show variables

Yesterday I posted on the curse of the autocommit when using jdbc, but as sholmi commented you can also see a ton of “show variables”  statements as the connector J tries to figure what settings the database is using.   I have seen this before as well and  you can reduce these calls as well, to do so try setting the cacheServerConfiguration paramter to true, which caches the variables instead of rechecking.  The official doc says:

“Should the driver cache the results of ‘SHOW VARIABLES’ and ‘SHOW COLLATION’ on a per-URL basis?”

This entry was posted in jdbc, mysql, performance, Uncategorized. Bookmark the permalink.

One Response to MySQL Connector J and the curse of show variables

  1. Shlomi Noach says:

    Nice! Will check this out.