Mom is right when she says to eat your peas.

In one of the largest surveys of data on global dietary habits and longevity, researchers found that consuming vegetables, fruit, fish and whole grains was strongly associated with a longer life — and that people who skimped on such healthy foods were more likely to die before their time.

The study, published on Wednesday in the British journal The Lancet, concluded that one-fifth of deaths around the world were associated with poor diets — defined as those short on fresh vegetables, seeds and nuts but heavy in sugar, salt and trans fats.

In 2017, that came to 11 million deaths that could have been avoided, the researchers said. Most of those, around 10 million, were from cardiovascular disease, researchers found. The next biggest diet-related killers were cancer, with 913,000 deaths, and Type 2 diabetes, which claimed 339,000 lives.