Search optimization in a very (100k+) large paths history