Reduce from 3 DB queries per node to 1 total query.
Reduce the running time by 50%...from 1 second to 0.5 seconds. A marvel of pointless optimization! At the time it seemed like it might matter, but the case that is really slow (requiring a call to nalloc per node) is still slow. But it was a twenty minute diversion.