This patch adds option to skip DB connection initialization commands completely using a configuration setting in settings.php.
Normal Drupal setups doesn't benefit from skipping DB connection init. In our experimental D7 setup where we have very complex MySQL cluster with read/write splitting and geographically distributed server nodes we found out DB init commands taking over a second of runtime because init commands were executed on remote MySQL master node. We have charset and sql_mode settings already set in MySQL server default settings so initialization commands are not needed at all in our setup.
This patch allows administrator to skip DB connect initialization commands completely if DB server in use has been configured with suitable default settings.
Please consider applying the patch to D7 and D8.