Speed up some duplicate queries