optimization for AQL queries with limit
make test succeed after Max's optimization