Cleanup excessive db queries in 1-1 relations.

[ fix #2701 ]