improving joins for both selects and update operations