As Philadelphia's Democrats prepare to vote Tuesday in the primary election for district attorney, two lessons from 2015 come to mind.

Money isn't everything in an election. And the city's so-called racial math is not always so black and white.

Two years ago, the Democrats had six candidates for the party's nomination for mayor.

Much attention was paid to so-called independent expenditure groups, which overshadowed the campaign fund-raising of the actual candidates.

One IE group put up $7.5 million to support State Sen. Anthony Hardy Williams, who finished second with 26 percent of the primary vote.

Williams lost to now-Mayor Jim Kenney, who was backed by three IE groups that spent nearly $4 million. He won with 56 percent of the primary vote.

Money was no recipe for victory. If it had been, Williams would have outpaced Kenney.

Race was also a hot topic in the 2015 primary, with two white candidates, three African Americans, and one Latino.

Williams, who is black, was expected to take a large swath of the African American vote. Instead, Kenney edged Williams among those voters, 46 percent to 41 percent.

Two years later, independent political action committees (PACs) are grabbing a lot of attention in the race for district attorney.

That is in large part because billionaire George Soros wrote a $1.45 million check on April 28 to fund Philadelphia Justice & Public Safety, which is backing Larry Krasner, a defense lawyer known for high-profile civil rights cases.

Another PAC, the Building a Better Pennsylvania Fund, is spending a fraction of that to back former Assistant District Attorney Jack O'Neill. That PAC is funded by the building trades unions.

To get a sense of the difference, the Soros-funded group is spending $380,000 on television in the last week while the building trades group is spending $88,000.

These PACs can ignore the city's campaign contributions limits, according to a 2010 U.S. Supreme Court ruling, if they don't coordinate with candidates.

Another Democrat, former city and state prosecutor Michael Untermeyer, sunk $1.25 million into his own campaign, becoming the fifth candidate in a local race since 2007 to trigger the "millionaire provision," doubling the campaign contribution limits.

Need another sign that money isn't everything? Three of the four previous self-funders did not win.

Race has been less of a factor this year in a field that includes four whites, one African American, one Latino, and one son of a Pakistani immigrant.

Joe Khan, the immigrant's son who worked as a city and federal prosecutor, won the endorsement of the Philadelphia Tribune, the oldest African American newspaper in the country.

Krasner, who is white, has the backing of key African American ward leaders from Northwest Philadelphia. Tariq El-Shabazz, a former first assistant district attorney and the only black candidate, has support from three African American City Council members: Jannie Blackwell, Curtis Jones Jr., and Cindy Bass.

Krasner on Thursday also picked up the endorsement of the Black Clergy of Philadelphia and Vicinity. That group's president, the Rev. Jay Broadnax, said race is an important factor in local elections, "in terms of sensitivity of issues people are concerned about."

But the racial math can be an "oversimplification" for how decisions are made, he added.

"It's not to say that race is a non-issue," Broadnax said. "That's definitely not the case. But to look at it solely [as a determination of how to vote] is a mistake."