Issue #3214825 by Wim Leers: Optimize SourceDatabase::getFormatsUsingTag(): avoid repeating the same queries