Optimize date lookup in wordhistory