optimize relation map