more complex JOINS to make database calls faster