materialize the manytomany relationship to have better control over queries