Improve the order of merging in the indexing DB query (helps on standard hard disks)