A drink a day may help you maintain a sharp brain and lower your risk of dementia as you get into your golden years, suggests new research we're happy to toast.

It's not exactly an excuse to order another round at happy hour. But a new study has some reassuring news for people who enjoy a daily drink or two: Moderate drinking is associated with healthy brain function in old age, according to a new study in the Journal of Alzheimer’s Disease.

But while regular booze consumption may be part of a healthy-lifestyle strategy for reducing dementia risk and memory issues, the study authors caution that their findings should be weighed against alcohol’s potential health risks, as well.

Compared to people who don’t drink at all, some (but not all) previous studies have shown that those who drink moderately tend to live longer. For this new study, University of California San Diego researchers wanted to see if moderate drinkers maintained healthy brain functioning as they edged into old age.

To find out, they followed 1,344 men and women, ages 55 to 84 at the start of the study, for up to 29 years. The participants answered questions about their drinking habits early on, and were given a standard dementia screening every four years after that.

The study used gender- and age-specific guidelines to categorize the participants’ alcohol intake: Moderate drinking was defined as up to one drink a day for adult women of any age and for men 65 and older. For adult men under 65, moderate drinking was defined as up to two drinks a day. (Heavy drinking was up to three drinks a day for all women and for men 65 and older, and up to four drinks a day for men under 65.)

Any alcohol intake beyond that was defined as excessive drinking, although only 5% of participants fell into this category. Separately, the researchers also categorized how frequently the participants drank—anywhere from never to near-daily (five to seven drinks a week).

When they crunched the numbers and looked at participants’ mental health over time, the researchers found that people who consumed moderate to heavy amounts of alcohol were about twice as likely to live to age 85 without cognitive impairment as did those who didn't drink at all. And those who drank on a near-daily basis were two to three times as likely to have healthy cognitive functioning at age 85 than they were to have developed dementia or died before 85.

That’s great news for regular imbibers. But before everyone busts out the bubbly, it’s important to note a few caveats. First, the study only recorded participants' drinking habits at one point in time, so the researchers can’t say whether they modified them over the follow-up period.

Second, the group of non-drinkers in the study was made up of both lifelong abstainers and people who had stopped drinking—which raises the possibility that some of them may have given up alcohol because of an underlying health issue that could have also affected their cognition later in life. The researchers did adjust their findings to control for preexisting health issues (as well as diet, smoking, and physical activity). But they likely couldn’t account for all possible outside factors.

To get our best wellness tips delivered to you inbox, sign up for the Healthy Living newsletter

And perhaps most importantly, 99% of the study participants were white and well educated, and they were all from a middle- to upper-middle-class suburb in San Diego County. So while the study suggests that regular drinking may benefit the aging brain in this specific population, it may not apply to people of other ethnicities or socioeconomic backgrounds.

The study authors point out that their research only shows an association between alcohol use and cognitive health, not a cause-and-effect relationship. While moderate drinking may have a direct effect on cognition, it’s also linked to higher incomes and education levels—which are, in turn, associated with healthier habits and better access to health care overall.

The research team also notes that alcohol use contributes to 88,000 deaths annually and is associated with “a substantial number” of health, economic, and societal consequences. (To name a few: Long-term excessive drinking can actually cause alcohol-related dementia, and even low to moderate consumption has been connected to an increased risk of several types of cancer.)

“Some people have health problems that are made worse by alcohol, and others cannot limit their drinking to only a glass or two per day,” said lead author Erin Richard, a graduate student in the Joint San Diego State University/UC San Diego Doctoral Program in Public Health, in a press release. “For these people, drinking can have negative consequences."

For these reasons, the study authors do not recommend that people who don’t currently drink start imbibing. “However,” they conclude in their paper, “among those who choose to consume alcohol, regular, moderate drinking may play a role in promoting cognitively healthy longevity.”