Skip to content

Instantly share code, notes, and snippets.

@bcmiller
Created April 13, 2012 18:26
Show Gist options
  • Save bcmiller/2378956 to your computer and use it in GitHub Desktop.
Save bcmiller/2378956 to your computer and use it in GitHub Desktop.
groups-distro
mysql> SELECT COUNT(uid), groups FROM (SELECT count(nid) as groups, ou.uid from og_uid ou INNER JOIN users u on ou.uid = u.uid WHERE u.status = 1 GROUP BY ou.uid) subq GROUP BY groups;;
+------------+--------+
| COUNT(uid) | groups |
+------------+--------+
| 34630 | 1 |
| 14223 | 2 |
| 12062 | 3 |
| 14619 | 4 |
| 1611 | 5 |
| 970 | 6 |
| 860 | 7 |
| 258 | 8 |
| 153 | 9 |
| 123 | 10 |
| 63 | 11 |
| 218 | 12 |
| 47 | 13 |
| 20 | 14 |
| 26 | 15 |
| 15 | 16 |
| 14 | 17 |
| 11 | 18 |
| 28 | 19 |
| 14 | 20 |
| 15 | 21 |
| 5 | 22 |
| 7 | 23 |
| 9 | 24 |
| 3 | 25 |
| 6 | 26 |
| 9 | 27 |
| 14 | 28 |
| 9 | 29 |
| 5 | 30 |
| 2 | 31 |
| 3 | 32 |
| 8 | 33 |
| 6 | 34 |
| 7 | 35 |
| 3 | 36 |
| 3 | 37 |
| 1 | 38 |
| 7 | 39 |
| 4 | 40 |
| 3 | 41 |
| 1 | 42 |
| 3 | 43 |
| 4 | 44 |
| 3 | 45 |
| 1 | 46 |
| 2 | 47 |
| 2 | 48 |
| 5 | 49 |
| 2 | 50 |
| 2 | 52 |
| 4 | 53 |
| 4 | 54 |
| 4 | 55 |
| 4 | 56 |
| 1 | 58 |
| 5 | 60 |
| 2 | 62 |
| 1 | 63 |
| 3 | 64 |
| 2 | 65 |
| 2 | 66 |
| 3 | 67 |
| 2 | 69 |
| 1 | 70 |
| 1 | 73 |
| 1 | 74 |
| 1 | 75 |
| 2 | 76 |
| 2 | 77 |
| 1 | 78 |
| 1 | 81 |
| 2 | 82 |
| 1 | 84 |
| 2 | 86 |
| 1 | 87 |
| 2 | 88 |
| 1 | 90 |
| 1 | 91 |
| 2 | 94 |
| 1 | 95 |
| 1 | 96 |
| 1 | 97 |
| 1 | 98 |
| 1 | 103 |
| 1 | 106 |
| 2 | 107 |
| 1 | 122 |
| 1 | 124 |
| 1 | 132 |
| 1 | 134 |
| 1 | 144 |
| 1 | 145 |
| 1 | 148 |
| 1 | 166 |
| 1 | 174 |
| 2 | 177 |
| 1 | 186 |
| 1 | 188 |
| 1 | 195 |
| 1 | 201 |
| 1 | 206 |
| 2 | 213 |
| 1 | 223 |
| 1 | 229 |
| 1 | 233 |
| 1 | 239 |
| 1 | 251 |
| 1 | 260 |
| 1 | 284 |
| 1 | 299 |
| 1 | 306 |
| 1 | 311 |
| 1 | 324 |
| 1 | 326 |
| 1 | 333 |
| 1 | 342 |
| 1 | 355 |
| 1 | 427 |
| 1 | 455 |
| 1 | 478 |
| 1 | 506 |
| 1 | 603 |
| 1 | 608 |
| 1 | 631 |
| 1 | 912 |
| 1 | 1911 |
+------------+--------+
127 rows in set (2.01 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment