Jump to content

User:SQL/Admin CSS-JS Editing

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SQL (talk | contribs) at 20:04, 5 August 2018 (grammar). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

These queries are variations the often cited "On the top five wikis, 75% of admins have never edited CSS/JS; 92% of admins have almost never done so." query. The thing is - we need to look in the context of editing other users css/js as well. This presents far different numbers:

The Query
SELECT    Sum(cnt=0 
OR        cnt IS NULL) 0_edits, 
          sum(cnt>0 
AND       cnt<=10) 1_10_edits, 
          sum(cnt>10 
AND       cnt<=100)    11_100_edits, 
          sum(cnt>100) 101_plus_edits 
FROM      user 
JOIN      user_groups 
ON        ug_group = 'sysop' 
AND       ug_user = user_id 
LEFT JOIN 
          ( 
                   SELECT   rev_user_text user, 
                            count(*)      cnt 
                   FROM     page STRAIGHT_JOIN revision 
                   ON rev_page = page_id 
                   WHERE    page_title RLIKE '^.*\.(css|js)$' 
                   AND      ( ( 
                                              page_namespace = 2 
                                     AND      substring_index( page_title, "/", 1 ) != REPLACE( rev_user_text, " ", "_" ) )
                            OR       page_namespace = 8 ) 
                   GROUP BY rev_user_text) edits 
ON        user = user_name;
Query pending

So, whom are the actual active admins here?

The Query II
SELECT    user_name, 
          cnt 
FROM      user 
JOIN      user_groups 
ON        ug_group = 'sysop' 
AND       ug_user = user_id 
LEFT JOIN 
          ( 
                   SELECT   rev_user_text user, 
                            Count(*)      cnt 
                   FROM     page straight_join revision 
                   ON rev_page = page_id 
                   WHERE    page_title RLIKE '^.*\.(css|js)$' 
                   AND      ( ( 
                                              page_namespace = 2 
                                     AND      substring_index( page_title, "/", 1 ) != REPLACE( rev_user_text, " ", "_" ) )
                            OR       page_namespace = 8 ) 
                   GROUP BY rev_user_text) edits 
ON        user = user_name 
ORDER BY  cnt DESC;
Query results pending