Add formergroup to various user api queries
Open, Needs TriagePublic

Description

Currently, list=allusers supports querying for users by their user_group using the augroup parameter. This is great and very useful. I'd also like to query users by their user_former_group. So I propose that we add a parameter called something like "auformergroup" that would allow for joining this table with user too.

Given that user_former_group seems to have similar indexes, I don't think this will incur any concerning additional load on the DBs.

query=userinfo and query=users should have a formergroups too

Halfak created this task.Mar 23 2017, 12:35 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2017, 12:35 AM
Halfak updated the task description. (Show Details)Mar 23 2017, 12:36 AM
Reedy moved this task from Unsorted to Needs Code on the MediaWiki-API board.Mar 23 2017, 12:52 AM
Reedy added a subscriber: Reedy.Mar 23 2017, 12:55 AM

For consistency query=userinfo and query=users should have a formergroups too...

Reedy renamed this task from Add auformergroup to list=allusers to Add formergroup to various user api queries.Mar 23 2017, 1:02 AM
Reedy updated the task description. (Show Details)
Anomie added a subscriber: Anomie.EditedMar 23 2017, 2:21 PM

Given that user_former_group seems to have similar indexes, I don't think this will incur any concerning additional load on the DBs.

The index existing on user_former_group (on ufg_user, ufg_group) is sufficient for listing the former groups of particular users and for filtering when most users were formerly in the group, but to filter by groups that have not had many users removed (i.e. most cases, I believe) I think we would need an index on the ufg_group column, similar to the ug_group index on user_groups.

If someone is going to do that, it might be beneficial to at the same time turn the existing unique index into the primary key for the table.