improve search by joining tables