faster joint query