A dynamic pivot selection technique for similarity search