When browsing questions tagged with , on the right sidebar it displays the related tags (such as , , and ).

Can someone tell me how to query in the SEDE to get the related tags of ?


You could use this comically inefficient query I just created.

It just looks for all of the Posts that have the tag you're searching for, then groups by the other tags on those posts, then displays those other tags in descending order by quantity.

It appears to line up precisely with the sidebar on the tags I tried. Here's :

PHP related tags

Note: User input is case-sensitive on that query, because I'm lazy =)

  • thank you very much, as you know to do such a complex query so much will slow down the database server, is it better to cache these related tags ?
    – jacky chou
    Jul 24 '12 at 4:30
  • 3
    @qqas: I think it is a separate server that caches old data (refresh once every few weeks) - so I don't think it is a problem even if the query is slow.
    – nhahtdh
    Jul 24 '12 at 5:12
  • 1
    @qqas nhahtdh is correct, Data Explorer runs on it's own hardware, and it also caches results. So if you run the same query over and over, you won't be doing full requests. Also, I imagine on the main site that the related tags are, in fact, cached. Jul 24 '12 at 12:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .