IIUC, the database connection logic in Drupal core depends on PDO's ATTR_SERVER_VERSION attribute to determine database language constructs etc. This attribute instantiates a connection and returns the version string using a SELECT query (generalization). This version string is then cached for subsequent queries for the life of the connection/
Steps to reproduce
Turn on the query logging feature of any database engine with drupal and see the SELECT like query for versions
Proposed resolution
Allow consumers to pre-establish this version string based on the settings.php configuration for the database
Remaining tasks
Write the test
Write the functionality
Replicate for each version of Drupal?
User interface changes
None
API changes
Data model changes
None
Release notes snippet
Developers can now specify an additional database option to specify the database engine, reducing the number of calls during connection instantiation