Olive oil is fantastic at many things, but it does not prevent spaghetti from sticking together. Because it floats to the top of the water while the spaghetti is cooking in the water, having the oil there does nothing to prevent the pasta from sticking together while cooking.