# Number of linked questions is shown incorrectly

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.)

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.

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

``````select *
where postid = 267286
or relatedpostid = 267286
`````` 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
{"ft_lang_label":"__label__en","ft_lang_prob":0.9470889,"math_prob":0.41895545,"size":2773,"snap":"2022-05-2022-21","text_gpt3_token_len":578,"char_repetition_ratio":0.20368364,"word_repetition_ratio":0.13539192,"special_character_ratio":0.22286333,"punctuation_ratio":0.12615955,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9538228,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-26T20:24:31Z\",\"WARC-Record-ID\":\"<urn:uuid:a55ced40-eb41-42eb-a236-524276768c35>\",\"Content-Length\":\"128924\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9d2b454c-6b8e-4c32-8e16-0ca22a2d4732>\",\"WARC-Concurrent-To\":\"<urn:uuid:b3681c86-ece3-438f-8a3f-35121d66d68d>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://meta.stackexchange.com/questions/267337/number-of-linked-questions-is-shown-incorrectly\",\"WARC-Payload-Digest\":\"sha1:FXI3XNEJPMUDJ5YU3CLHZ3OWWIDVZR42\",\"WARC-Block-Digest\":\"sha1:SX3MI3FUUGTNJYV77GSWYIREVIIJ7GTQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662625600.87_warc_CC-MAIN-20220526193923-20220526223923-00342.warc.gz\"}"}