Use empty query instead of SELECT 1 to check active connection
Extracted from #220055 (comment 463405732)
ActiveRecord uses SELECT 1
to check the liveness of a connection. We are seeing this query causes a very high frequency on GitLab.com.
As shown in #220055 (comment 463405732), using an empty query ;
instead of SELECT 1
increases throughput - which is what this issue is about.
We can see if we can patch this locally and if successful, upstream this into Rails.
Edited by Andreas Brandl