Plush Studios/Blend Images/Corbis

Maybe unemployment isn’t so bad after all. A new study says that, income notwithstanding, having a demanding, unstable and thankless job may make you even unhappier than not having a job at all.

Given that a paid position gives workers purpose and a structured role, researchers had long thought that having any job would make a person happier than being unemployed. That turns out to be true if you move into a high-quality job — but taking a bad job is detrimental to mental health.

Australian National University researchers looked at how various psychosocial work attributes affect well-being. They found that poor-quality jobs — those with high demands, low control over decision making, high job insecurity and an effort-reward imbalance — had more adverse effects on mental health than joblessness. (More on Time.com: Why the Recession May Trigger More Depression Among Men)

The researchers analyzed seven years of data from more than 7,000 respondents of an Australian labor survey for their Occupational and Environmental Medicine study in which they wrote:

As hypothesized, we found that those respondents who were unemployed had significantly poorer mental health than those who were employed. However, the mental health of those who were unemployed was comparable or more often superior to those in jobs of the poorest psychosocial quality… The current results therefore suggest that employment strategies seeking to promote positive outcomes for unemployed individuals need to also take account of job design and workplace policy.

Moving from unemployment to a job with high psychosocial quality was associated with improvements in mental health, the authors said. Meanwhile, the mental health of people in the least-satisfying jobs declined the most over time — and the worse the job, the more it affected workers’ well-being.

Unemployed people in the Australian study had a mental-health score (based on the five-item Mental Health Inventory, which measures depression, anxiety and positive well-being in the previous month) of 68.5. Employed people had an average score of 75.1. The researchers found that moving from unemployment to a good job raised workers’ scores by 3.3 points, but taking a bad job led to a 5.6-point drop below average. That was worse than remaining unemployed, which led to decline of about one point.

These findings underscore the importance of employment to a person’s well-being. Rather than seeking any new job, the study suggests, people who are unemployed or stuck doing lousy work should seek new positions that offer more security, autonomy and a reasonable workload. But that’s a lot easier said than done. (More on Time.com: Among American workers, fear of losing your job is linked to health problems)

Perhaps employers could be persuaded to be more mindful of the mental health of their workers — happier employees are a benefit to their employers. “The erosion of work conditions,” the researchers noted, “may incur a health cost, which over the longer term will be both economically and socially counterproductive.”

More on Time.com:

Survey: 9% of Americans Are Depressed

Dads’ Dark Side: New Fathers with Depression Spank Their Babies More