optimize sentence insertion and deduping by reducing numbers of queries