Mayor Bill de Blasio of New York became the 23rd Democrat to enter the race for the White House on Thursday, and he is expected to try to position himself toward the leftward edge of the field. But running a local government typically means making compromises, and Mr. de Blasio’s record is more complex than his rhetoric.

He can lay claim to running a larger executive branch than any of his rivals, with the exception of Joseph R. Biden Jr.’s two terms as vice president. (New York City has more residents than the home states of each of the three governors in the race, Colorado, Washington and Montana.) And he can tout New York’s booming economy and falling crime rate while pointing to a flurry of other liberal agenda items he has pursued.

Mr. de Blasio, 58, rose to the mayoralty as a self-styled progressive, and he has repeatedly called for the national party to move to the left. Back home, though, he has proved a more cautious politician. He has supported incumbent Democratic politicians against progressive insurgents, for instance, and he has drawn persistent criticism from his left flank. An early biography of Mr. de Blasio was titled “The Pragmatist.”

As a bearded young man in the late 1980s, Mr. de Blasio admired the cause of the leftist Sandinistas of Nicaragua. But in New York, he rose to power as a political insider who worked in City Hall and later managed Hillary Clinton’s 2000 Senate campaign before starting his own political career.