improving QueryPartitioner