The Reference Desk/Companion viewing previous companions

From Tardis Wiki, the free Doctor Who reference

There was an episode of the new series, or perhaps a prequel or mini-episode, in which a new-ish companion is aboard the Tardis and accesses a visual display of all the Doctor's previous companions. She notices and says something to the Doctor about the fact that most of the companions were women. I can't remember which Doctor, which companion, or which episode. Can someone remind me?