According to recent statistics, 29.1 million people—that’s 9.3 percent of the population—have diabetes. Almost 30 percent of these people have not been diagnosed, however. It gets worse. Fully 86 million more people—that’s over one third of U.S. adults—have prediabetes (high blood sugar, the precursor to diabetes), yet ninety percent of them don’t know it. Truly, these numbers reveal the epidemic nature of this largely preventable disease.

A recent study published in the Annals of Internal Medicine found that people diagnosed with diabetes during midlife are more likely to experience memory and cognitive problems during the next 20 years than those people with healthy blood sugar levels. A 60-year-old with diabetes will exhibit the same cognitive decline as a healthy person who is five years older. Diabetes shaves five years off your cognitive health, just like that.

“The lesson is that to have a healthy brain when you’re 70, you need to eat right and exercise when you’re 50,” noted lead researcher Elizabeth Selvin, PhD, MPH.

The study followed a group of almost 16,000 middle-aged adults and found 19 percent more cognitive and memory decline in people with poorly controlled diabetes, and found smaller declines even in people with controlled diabetes and prediabetes.

“Knowing that the risk for cognitive impairments begins with diabetes and other risk factors in midlife can be a strong motivator for patients and their doctors to adopt and maintain long-term healthy practices,” noted A. Richey Sharrett, MD, DrPH, another researcher.

News that high blood sugar increases risk for dementia is not new. In fact, Alzheimer’s disease is also known as type 3 diabetes. If you have not had your blood sugar checked recently, please do. Ask your doctor to also check your insulin level, which is a sign that blood sugar abnormalities may be on the horizon.