UNE-394: Fix slow query in local print plugin