query.cc: allow to return query results unsorted