You should use the un(der)-documented `logging_logindex` view instead of `logging`.

On Wed, Apr 15, 2020 at 17:56 Maciej Jaros <egil@wp.pl> wrote:
Not sure if this is an appropriate place to discuss this but I'm not able to run this query:
https://quarry.wmflabs.org/query/24267

Even a minor part of this query like below needs a significant time to complete.
   SELECT count(*) as review_count, log_actor
    FROM logging
    WHERE log_type = 'review' AND log_action = 'approve'
    GROUP BY log_actor

I tried with logging_userindex but that don't seem to help. Any chances on adding extra indexes to make such queries work? I think querying log_type and log_actor should be quite common for various user stats.

Even this takes almost 200 seconds to complete:
    SELECT count(*) as review_count, log_actor
    FROM logging_userindex
    WHERE log_type = 'review' AND log_action = 'approve'
    AND log_timestamp >= 20190101000000
    AND log_timestamp <= 20190101235959
    GROUP BY log_actor

Also note that the query
24267 used to work in January 2020. I searched through the list, but haven't found any changes related to the logging table since January.

Cheers,
Nux.
_______________________________________________
Wikimedia Cloud Services mailing list
Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org)
https://lists.wikimedia.org/mailman/listinfo/cloud