On Wed, Mar 25, 2015 at 11:12 AM, Yuri Astrakhan <yastrakhan(a)wikimedia.org>
wrote:
Lots of internal FauxRequests calls to ApiMain,
that's bad code structure.
Are you suggesting we should not use API internally?
Yes, that's exactly what I'm suggesting. Rather than marshalling through a
FauxRequest and going through all the other overhead of the API, you should
have some sort of backend class that does the necessary work and call that
both from the API and from the places you're trying to call the API
internally.
There's a similar possibility for broken
continuation when 'mode' is set,
or else your query is probably making MySQL be
stupid by ordering by
constant gl_perm.
gl_perm is a constant for that query, i was unsure if Mysql would pick the
right index here, so included it in the "order by" just to be safe. I
could force index instead - what's the best practice with the new mysql?
I thought it might be, but I wasn't entirely sure.
MySQL tends to be even stupider than that: if you have "foo =
'constant'"
in your WHERE clause and also ORDER BY foo, it will insist on filesorting.
Unless they fixed that in the very latest versions of MariaDB.
--
Brad Jorsch (Anomie)
Software Engineer
Wikimedia Foundation