introduction of buckets (according to prefix of most signficant digits of hash) into query to optimise sort