On Fri, Jun 20, 2008 at 7:26 PM, Brion Vibber <brion(a)wikimedia.org> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Simetrical wrote:
On Fri, Jun 20, 2008 at 2:46 PM,
<demon(a)svn.wikimedia.org> wrote:
No need to count(*) in SiteStats::admins
...
- self::$admins = $dbr->selectField( 'user_groups',
'COUNT(*)', array( 'ug_group' => 'sysop' ), __METHOD__ );
+ self::$admins = $dbr->selectField( 'user_groups',
'COUNT(ug_group)', array( 'ug_group' => 'sysop' ), __METHOD__
);
What is this intended to do? ug_group is NOT NULL; COUNT(ug_group)
will always be identical to COUNT(*).
There is an urban legend that count(field) is faster than count(*),
since it doesn't have to load all those fields specified by the '*'. I'm
pretty sure it's not actually true, though, and that the database knows
that '*' just means "count the rows" here. :)
- -- brion
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAkhcPLwACgkQwRnhpk1wk47T7QCeIXzYsnuOq6dP6IGNdMWIdUf5
I+8Anj01N3RGsCgEfKevh+ZiGVnM2rpz
=phbF
-----END PGP SIGNATURE-----
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Count me in the list of people who were fooled by the rumors then.
-Chad