dramatically improve duplicates queries