Attempt to make MySQL saving more efficient