Redmine/6523: don't hit performance database unnecessarily