For years, I thought of exercise in terms of calories in and calories out: Eat too much pizza on Saturday night, take an extra spin class. Skip an hourlong run, skip a bagel the next day. Train for a triathlon, eat whatever I want — because, hey, wasn’t I burning like a zillion calories a day?

This approach had two problems. First, it didn’t work. My workout load seemed to have no bearing on my weight, and this isn’t just anecdotal; studies have shown that exercise isn’t a particularly effective way of losing weight. Second, it seriously screwed up my relationships with both food and exercise, two things that I inherently enjoy. I worked out way past the point of fun because I felt I had to make up for the previous day’s overindulgences — which I hadn’t really enjoyed because I was already anticipating the need to burn them off.

My lightbulb moment came when I no longer had time for the longer workouts I’d done in my relative youth. I’d try to shoehorn them into my schedule, but I couldn’t keep that up for long, so my exercise life became inconsistent and guilt-ridden. Finally, I decided that just regularly doing something, even if it was only a short run or throwing a few weights around, was better than the all-or-nothing cycle I’d settled into. Running 20 minutes most days of the work week didn’t feel like a big burden, but it added up to much more exercise than one failed attempt to run for 50 minutes every two weeks. As it turns out, my shorter routine was already pretty much meeting the recommendations for preventing heart disease, diabetes, cancer and early death. And because I knew my new regimen wasn’t burning a ton of calories, I started paying more attention to my eating habits. Exercise became a way to achieve better health, not control my weight.

This shift in thinking has profoundly changed my life. When I stopped leaning on exercise to save myself from my dietary habits, it became more fun and doable.

I had visions of a self-help book empire based on this insight, but alas, it turns out I wasn’t the first to have it. Yoni Freedhoff, a family physician and medical director of the Bariatric Medical Institute in Ottawa, has spent years pushing for “detaching exercise from weight loss and reattaching it to health.” As he likes to say, regular exercise is the single best thing you can do for your health. Evidence suggests that it can lower cholesterol and blood pressure, reduce deaths from heart disease, prevent and treat Type 2 diabetes, improve respiratory fitness in people with asthma, and help with depression, among other things. As many experts have observed, if exercise were a pill, it would be the most beneficial medication on the market.

Yet despite all its health benefits, exercise is not a particularly effective tool for weight loss. One review from 2014 found that unless you’re doing an awful lot of aerobic exercise, you’re not likely to lose a lot of weight. Without caloric restriction, most people who are overweight and obese can expect to lose up to about 4 pounds with exercise, the authors wrote. That’s not the same as saying it’s totally useless — it isn’t. It appears to help, albeit modestly, lessen weight gain over the long term. And it seems to reduce the chances that lost weight will creep back.

But we actually don’t burn a ton of calories when we exercise, Freedhoff said. If we did, we wouldn’t have survived as a species during the majority of human history when calories were scarce. That’s especially true in relation to the food we eat. For example, a 155-pound person burns 298 calories in 30 minutes of running at a 12-minute-mile pace. But the same person burns 42 calories in a half-hour of sitting around reading a book, so the net burn is closer to 256. That barely covers a half-cup of Ben & Jerry’s, depending on the flavor.

There are also studies suggesting that even when we increase activity, our overall caloric expenditure holds steady, for reasons not fully understood. Perhaps we unconsciously compensate for workouts by being less active during the rest of the day. Of course, there will always be exceptions, but in general, exercise has a “disappointing” influence on weight, Freedhoff said.

If you’re exercising with the expectation that you’ll lose weight, you may be discouraged and tempted to quit when the pounds don’t peel off, he said. There is even research suggesting that people who believe obesity is caused by a lack of exercise rather than a poor diet are more likely to be overweight and to eat more.

On the other hand, if your goal is general health, there is plenty of evidence that exercise is effective. Public health groups, including the Centers for Disease Control and Prevention and the American College of Sports Medicine, are in consensus: Aim for a minimum of about 150 minutes per week of moderate-intensity exercise, such as brisk walking; 75 per week of more intense exercise, such as running, aerobics or fast cycling; or some combination of the two.

Why 150 minutes? “It’s the magic number because according to the epidemiological research, that’s the critical point where you start to see more substantial changes in the risk of disease and mortality,” said Carol Ewing Garber, a professor of movement sciences at Columbia University and an author of the ACSM’s guidelines. There’s a benefit at lower levels of activity — something is definitely better than nothing — but the 150-minute-mark weekly is where you start getting a better bang for your buck, she said.

Public health groups also recommend regular strength and flexibility training, something that I had a much easier time fitting in when I wasn’t trying to aerobicize myself into a smaller pants size. Strength training is particularly important to fight off the loss of muscle mass as you age.

Of course, public health recommendations for entire populations aren’t going to fit everyone. Individual response to exercise varies, and some people need more than others to get to the same level of fitness, Garber said. And diseases may require different amounts of exercise for prevention. A meta-analysis published in 2015 suggested that to substantially lower the risk of heart failure, people needed to exercise two or four times the current public-health recommendations. Again, though, even though “more is consistently better” with heart failure prevention, anything is better than nothing, said Ambarish Pandey, a cardiology fellow at UT Southwestern Medical Center and an author of the study.

More exercise than the minimum is definitely associated with “additional and more extensive health benefits,” according to the CDC. So if you’re happily exercising beyond the current recs, great! But that’s not strictly necessary: You can do something really great for your health by simply meeting the exercise guidelines, even it it’s not the best way to tackle your weight. If you’re like me, that reframing may even make exercise more pleasant and rewarding.