Follow-up from "Fix performance problem of tags query"

The following discussion from !20555 (merged) should be addressed:

  • @grzesiek started a discussion: (+8 comments)

    Is that going to reduce a number of queries by one? I wonder how can we describe this change in a unit test. Perhaps we don't need one, but we should at least consider adding a test to prevent this from happening in the future.

Related to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555