All fantastic suggestions. The EXPLAIN results showed that changing to logging_userindex had potentially the largest impact (reducing the rows to be retrieved from 10mil to 5mil). I am rerunning the query with all suggested recommendations, and will report back.

On Sat, Dec 30, 2017 at 1:32 PM, Dennis Tobar <dennis.tobar@gmail.com> wrote:
Replace count(*) with count(1) in the subquery. It could help (?) to improve the performance.

Dennis Tobar Calderón
(Enviado desde un móvil)

El 30 dic. 2017 3:10 p. m., "John" <phoenixoverride@gmail.com> escribió:
I would also find the first log of 2017 and use that instead of the timestamp

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

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