mapNodes: Combine 2 sql queries to try to speed things up.