@Martin I think that is nicest / cleanest way to solve that. PostId and PostHistoryTypeid are indexed so their join will be pretty effective as shown in the execution plan: data.stackexchange.com/math/revision/1066724/1318324/…
Not sure this is worth a question on Meta... I was looking up the tumbleweed badge query posted recently and for some reason it appears jumbled in the smaller communities?