[Git][ghc/ghc][wip/torsten.schmits/mwb-26-01/mp-backports] Avoid expensive computation for debug logging in `mergeDatabases` when log level is low