Observation counts for two users combined less than each individually

since looking at this last, i think this may actually be related to this: https://forum.inaturalist.org/t/majority-of-my-observations-do-not-appear-if-i-use-the-show-only-my-observations-feature/21746/5.

compare:

i’m just guessing here, but i suspect when you do a user_id=[single user login] query, it will lookup the numeric id based on login and then get results from the database using user_id=[single user id]. but when you do a user_id=[multiple user login] query, it will switch to user_login=[multiple user login].

originally, i thought that they must have been storing a user_login along with each observation in the observations table, but i don’t think that’s the case based on https://github.com/inaturalist/inaturalist/blob/main/db/structure.sql#L2831-L2884

so it must be making that tie some other place. i’m not certain how ElasticSearch indexes work, but i suspect the problem is there. if the tie between observations and old logins occurs in one of those, then i guess those indexes just need to be updated whenever a user changes their login.

2 Likes