[Labs-l] Tool labs replicas are missing the indexes?
Brad Jorsch (Anomie)
bjorsch at wikimedia.org
Tue Nov 11 13:36:03 UTC 2014
On Tue, Nov 11, 2014 at 1:02 AM, Giovanni Luca Ciampaglia <
gciampag at indiana.edu> wrote:
> Is there a reason why the tables on the Labs replica are not indexed?
>
They are.
> Drawing a list of random titles with page_random takes more than a minute!
>
Because you're doing it wrong. "page_random > rand()" evaluates rand() *for
each row*. Since it's nowhere near constant, it can't use an index.
MariaDB [enwiki_p]> show index from page;
> Empty set (0.00 sec)
>
That's because enwiki_p.page is a view. The indexes are on enwiki.page,
which you can see the definitions of with "show create table enwiki.page".
("show index from enwiki.page" gives a permission error, likely the same
paranoia about exposing cardinality that makes a normal explain not work.)
--
Brad Jorsch (Anomie)
Software Engineer
Wikimedia Foundation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/labs-l/attachments/20141111/d11dbff9/attachment.html>
More information about the Labs-l
mailing list