4

For any question I can view questions linked from/to it by from the url of the form: https://meta.stackexchange.com/questions/linked/id where id stands for the number of question. If some question has many linked posts, then this link is even available - by clicking on "see more linked questions..." at the bottom of linked questions list.

When going to this link, you can see on the right: n questions linked to/from, where n should be the number of the questions shown on that page. (At least if I understand this correctly.) But often this seems not to be the case.

My question is:

  • Is this a bug or is it intended behavior?
  • Since the number of the questions is clearly different from the number of posts shown, what exactly this number means?

There was a post which seems related (or even duplicate?): Number of linked questions in the sidebar is incorrect: some posts are counted twice. I do not have sufficient reputation to see deleted posts, but I found this one using Google and I can still see some version of the post in Google Cache. I do not know to which extent this question was changed before it was deleted. But in the cached version I see as a suggested explanation that the questions which are linked as duplicates are for some reason counted twice. Is the same thing happening here? (This explanation is consistent with the numbers given in the examples I have listed below.)


Just a few random examples I was able to find (with the description how they behave at the moment, sorted by the id in the descending order). I should say that many of the questions I tried displayed the correct number.

One example from another site: https://math.stackexchange.com/questions/linked/1140396 shows only two questions but says that there are 4 questions. (Notice that both number and questions shown are changed after switching to to active tab, but the number is still incorrect. This is where are originally noticed this behavior.)

3

This is fixed (tested for the examples given in the post, but I expect it to work generally) in build 3747 on MSE/MSO, and build 2870 on other sites.

4

There are indeed 2 links as can be seen from this SEDE query if I take your first example:

select *
from postlinks
where postid = 267286
or relatedpostid = 267286

postlinks result with linktypeid 1 and 3

The difference is the linktypeid. By looking up those values in Database schema documentation for the public data dump and SEDE we learn what those magic 1 and 3 mean:

1. Linked
3. Duplicate

So the number you see reflects all possible links, either a direct link (LinkTypeid == 1) (because of a link to the target question from a comment, answer or question body) or a duplicate close vote (LinkTypeId == 3). Only the direct links (LinkTypeId ==1 ) are shown in the list.

Keep in mind that the PostLinks table doesn't get updated if posts are edited or comments are removed. This is also true for the generated boilerplate comment when a user close vote a duplicate. The order of events for duplicate voted questions is as follows:

  1. Question posted
    • no records in PostLinks
  2. Close vote as a duplicate
    • Comment generated possible duplicate of: /q...
    • PostLink: -> LinkType 1 added (due to the comment)
  3. Fifth close voter votes for the duplicate
    • PostLink: -> LinkType 3 added (due to the final duplicate vote)
    • All comments referencing the duplicate target are removed
  4. /linked will show one question (for the LinkType 1),
    • PostLinks still has 2 records and will that will remain like this
  • I have some doubts about the last sentence in your answer: Only the direct links are shown in the list. Should this mean that if a question is closed as a duplicate, but the duplicate target is not mentioned in the comments/answers/question, then it is not shown among linked questions? I do not think this is how it works. (See also an example I have posted in chat.) – Martin Oct 5 '15 at 5:50
  • No, it means that if it gets closed as a duplicate it gets an record in postlinks as linktype=3, no need to be mentioned in a post or comment. The example you provided in chat was to recent to have that linktype=3 in SEDE as SEDE us only update once a week, on sunday morning 03:00 UTC – rene Oct 5 '15 at 6:28
  • Thanks for the elaboration of the part I found unclear. (And also for the explanation you gave me in chat.) – Martin Oct 5 '15 at 7:33

You must log in to answer this question.

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