maybe it could be slightly faster if we looked up XX before executing this query and just used the id in here?