Last modified: 2011-03-13 18:04:32 UTC
I would like a way to find all articles started by a given user via api.php. In other words, when listing usercontribs, have the ucshow param accept "new" as a value, in addition to minor.
That's not efficiently possible.
(In reply to comment #1) > That's not efficiently possible. > To elaborate on that a bit: whether a contribution or revision is "new" (i.e. the first revision of a page) isn't stored anywhere. The only way to find out is to go through all revisions of the same page and see if there's an older one. Combine that with a huge revision table (250M on enwiki) and very busy database servers and you'll get overloaded database servers slowing down Wikipedia, possibly to the point of unresponsiveness.
Thank you for the comments, I appreciate the explanation. I'll reopen this bug (just this once), to request it be marked for future development, because I would find this functionality useful on Wikipedia and also on my installation of MediaWiki. I've used a query like this to find out who is the creator of a given page, but that won't be of much use to find all pages started by a given user: SELECT p.page_id AS page_id, MIN(r.rev_id) AS first_revision_id, r.rev_user as user_id FROM page AS p LEFT JOIN revision AS r ON(p.page_id = r.rev_page) WHERE p.page_title = 'Title' How about storing the user id of the person who made the first revision of each page right in the page table? page_first_user or so? What would the downsides of doing something like that be? Thanks.
(In reply to comment #3) > I've used a query like this to find out who is the creator of a given page, but > that won't be of much use to find all pages started by a given user: > > SELECT p.page_id AS page_id, MIN(r.rev_id) AS first_revision_id, r.rev_user as > user_id > FROM page AS p > LEFT JOIN revision AS r ON(p.page_id = r.rev_page) > WHERE p.page_title = 'Title' You'd have to repeat that query op to 5,000 times, once for every page queried. The database servers aren't gonna like that. > How about storing the user id of the person who made the first revision of each > page right in the page table? page_first_user or so? What would the downsides > of doing something like that be? Such a field would be of limited use (only useful for this query and pretty much nothing else). Also, the 'creator' of a page can change (in theory; doesn't happen much in practice I guess), and the conditions under which that happens aren't easily detectable. All in all, I'd say it wouldn't be worthwhile to add such a rarely used field. > I'll reopen this bug (just this once), to request it be marked for future > development, because I would find this functionality useful on Wikipedia and > also on my installation of MediaWiki. If you really wanna go through with requesting page_first_user or another database field or index to facilitate this feature, you should file a separate bug for that. Closing this one as WONTFIX again.