On Wed, Mar 22, 2017 at 3:44 PM, Federico Leva (Nemo) nemowiki@gmail.com wrote:
Andre Klapper, 22/03/2017 13:51:
Does anyone know of a way to look up the top editors for a certain namespace (like "Module") across all Wikimedia sites?
The easiest way is usually to run the relevant SELECT queries with a small bash script on Labs or with sql.php on tin (e.g. https://phabricator.wikimedia.org/T128326#3100126 ).
I would discourage running long running scripts into production (tin is reserved for that)- we have special analytics slaves for that. However, probably those stats do not require access to private data. A query like:
use <wiki you are interested in>;
SELECT rev_user_text, count(*) as count FROM revision JOIN page ON rev_page = page_id and page_namespace=<desired numeric namespace> GROUP BY rev_user_text ORDER BY count(*) DESC LIMIT <number of top users>;
(maybe revision_userindex instead of revision?)
...on labs would work (this is by heart, it may have mistakes)
If it is a large wiki or there is a lot of edits, that may not finish- so you may have to do the analysis in small chunks and the aggregate results. Maybe someone has pre-crunched stats if you need it faster?