A 20-year study shows just how much body type and physical activity affects one’s lifespan.

While our diets certainly can impact longevity for better or for worse, a recent study suggests just how much body types also affect one’s lifespan. Recently published findings from The Netherlands Cohort Study illustrates how one’s height, weight, and changes in body mass index (BMI) in adulthood can have a major influence on lifespan.

Researchers analyzed over 120,000 men and women between the ages of 55-69 in an attempt to find links between height, weight, sedentary lifestyles, physical activity, and the likelihood of reaching the age of 90. Researchers also wanted to find if there were any disparities in the impact of these factors on each sex—and they discovered there was.

Participants were given a baseline health and lifestyle questionnaire asking their current height, current weight, their weight at age 20 as well as the overall activity levels. Then, researchers monitored participants until their 90th birthday or their death. Findings show that over 34 percent of female participants lived to at least 90, while less than 17 percent of males did.

Results of this 20-year study were published in the Journal of Epidemiology and Community Health, suggesting that taller women with lower weights and less weight fluctuation throughout adulthood had the greatest chance of living 90 years or more.

The amount of physical activity made the biggest impact on lifespan in men. Women who were 5'5" or taller had a 31 percent higher chance of making it to 90 years old than women who were shorter than 5'3" (or less). Those women who lived to be 90 had also put on less weight over their life and had a normal BMI at the beginning of the study.

Looking for the right foods to eat (and avoid) for optimal health?

The study did not find an association between body type and longevity in men, but lifestyle behavior and illness history did seem to influence their lifespan, particularly differences between smokers and non-smokers.

The level of physical activity in participants made its biggest impact on longevity in men. Men who spent 90 minutes exercising a day, on average, had almost a 40 percent higher chance of living to 90 than those who spent 30 minutes or less on exercise a day. On top of that, every extra 30 minutes spent exercising a day increased the men’s chances of living to 90 by five percent.

Physical activity did impact women’s lifespans, but in smaller amounts, and less exercise was needed each day. Women who spent just 30 to 60 minutes exercising each day had a 21 percent higher chance of reaching 90 than more sedentary women, and those who clocked in 60 minutes of daily exercise had the best chance overall.

The bottom line: While you can’t exactly alter your height, you can adjust your diet in pursuit of healthier weights—focusing on lifestyle changes rather than short-term crash diets for ultimate longevity.. Ramping up your physical activity also prevents a host of chronic diseases, making that long walk or 30-minute spin class a top priority to sneak in throughout the week.