[Labs-l] query optimization

John phoenixoverride at gmail.com
Wed Oct 28 19:31:10 UTC 2015


Actually using the date as the first filter rule will improve performance
because the IN filter then only has to be applied to a small subset instead
of all revisions.

On Wed, Oct 28, 2015 at 3:28 PM, Yetkin Sakal <superyetkin at yahoo.com> wrote:

> No, that will not help.
>
> Do you know any tools that use the revision view and execute efficient
> queries on it? I am not sure what I am missing here.
>
>
>
> On Wednesday, October 28, 2015 9:54 PM, Jaime Crespo <
> jcrespo at wikimedia.org> wrote:
>
>
> https://phabricator.wikimedia.org/P2251
>
> Sorry, no time to do a full profile, even if I would love to, but maybe
> that is helpful :-(
>
> On Wed, Oct 28, 2015 at 7:44 PM, Yetkin Sakal <superyetkin at yahoo.com>
> wrote:
>
> user_daily_contribs having been dropped, I am facing serious problems
> about a query. How to optimize this?
>
> SELECT
>     u.user_name,
>     COUNT(rev.rev_id) AS contribs
> FROM
>     user u
>     INNER JOIN user_groups ug
>     ON u.user_id = ug.ug_user
>     INNER JOIN revision_userindex rev
>     ON rev.rev_user = u.user_id
> WHERE
>     ug.ug_group IN ('sysop', 'bureaucrat', 'checkuser', 'oversight')
>     AND rev.rev_timestamp >= 20150928000000
> GROUP BY
>     u.user_name
>
>
> _______________________________________________
> Labs-l mailing list
> Labs-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l
>
>
>
>
> --
> Jaime Crespo
> <http://wikimedia.org>
>
>
>
> _______________________________________________
> Labs-l mailing list
> Labs-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/labs-l/attachments/20151028/4f56f36e/attachment-0001.html>


More information about the Labs-l mailing list