This maint script can be extremely slow to run.
After T147957 we decided to run the query on vslow. It was maybe not necessary to use vslow for every cases.
@EBernhardson suggested to use vslow only when we have to filter on namespace.
This appears to be a "nice to have" since it didn't block the upgrade to ES5. Please correct me if I'm wrong. :-)