Adding Active Record SQL optimization (3 statements, 1 statement)