Eliminate num_nodes on map? calls

By using the number of rows that postgresql returns after an insert we can avoid a sequential scan on tmp_nodes.

This should increase speed, and benchmarking showed a 0.7% increase in speed over a small testsuite. It's not a huge gain and it would be a lower percentage on a larger dataset with more disk access, but every bit helps.