Mark Smith shakes the family tree of Sarah Jessica Parker.

Over the years, many of my girly friends (and even some of my female friends too) have told me that I should watch Sex and the City, that it’s brilliant, that I’d love it; but for a long time I resisted, for two reasons. First, the contrary side of me means that the more someone goes on about how good a programme is, the more I try to avoid it, which has meant that I’ve missed out on a lot of programmes that are probably very good. The second reason was that from the glimpses I saw of it, usually over my shoulder on the way out of the room, it just looked profoundly irritating. Watching all those tall, thin, swaggering, cackling, fun-loving stiletto-women felt like being nagged from above for not having enough fun, for not being liberated enough. It was like being hacked at by a glittery axe.

I have to say that all this prejudice against Sex and the City probably infected my impressions of its stars too, particularly Sarah Jessica Parker, who plays Carrie. This was a programme pretending that clothes and bags and even sex have hidden depths, which they don’t (it’s just clothes, bags and sex), and so I assumed Sarah Jessica Parker felt that way too. I think this might have even crossed the minds of the makers of Parker’s episode of Who Do You Think You Are? (BBC One, Sunday, 9.15pm) because before the credits had even started, there was a clip of her telling us that she was nothing like Carrie.

To be fair, within minutes of the start, it was obvious Parker was right: she is nothing like Carrie. Carrie is obsessed with the trivial aspects of herself: mainly what she should wear and eat. Here, Parker was just as obsessed with herself but with a much healthier part of it: her past and how much of that past has made her present. “We’re mutts,” she said of her family. “A variable buffet of everything.” And then she admitted what all of this was really about: “We’ve been looking for an identity all our lives.”

Parker had thought that identity was partly German, but as the programme progressed she found out that her family is actually thoroughly American. As she leaned over the old records and her brow creased with interest (yes, creased - the woman hasn’t had botox, good on her) she started to uncover the story of an ancestor, John Hodge, who followed the rumours of gold in California and ended up travelling 23,000 miles to hack at rock with a pickaxe before dying a few weeks later, probably of cholera. This is one of the things Who Do You Think You Are? does so well: show how human beings used to have to struggle and fight and sweat on the edge of life and death, and how most of us just don’t have to do that any more. Maybe that’s why this programme works: those of us who don’t have to struggle crave some kind of connection with those who used to have to.

And then things got even more interesting because, as Parker dug deeper and found a relative called Esther Elwell, she discovered that her family might be made not just of good stuff but bad stuff too. Esther was at the centre of one of the witch trials in Salem, but the question was: could she have been an accuser? Eventually, the historical documents revealed the truth: Esther was a pointee rather than a pointer, and the even better news was she escaped when the trials were disbanded.

Even then, Parker felt a little guilty about her relative and the fact she escaped when so many didn’t. And that turned up another of the good things about Who Do You Think You Are?: it exposes the fact that’s it’s almost impossible to dig into a family tree without feeling some guilt or sadness, without uncovering the bad as well as the good. That might make Who Do You Think You Are? a melancholic programme, but that’s fine. There’s nothing wrong with a little bit of sadness.