Better optimized the map, not using 2 SQL connections now.
Signed-off-by: Michael Englehorn <Michael@englehorn.com>