Replace id DB searches with hash searches