On the diameter of an ideal