Share tags2

Supersedes #11351.
Can we move the usort and filtering (if needed) to the database layer? Makes much more since to not return the full result if its not needed and do the heavy lifting before :)