Further improvement in support for long queries