Semantic Transaction Optimization in Relational Databases