The Serb, the ninth seed, wrapped up the match against the world 121 in one hour and 25 minutes.
The 31-year-old was far from his best but had the nous to overcome fellow veteran and home hope Polansky.
Wimbledon
'Very, very difficult to beat Novak' - Expert view: can Sinner down Djokovic?
9 HOURS AGO
"I thought I served well in the moments when I really need it and I was looking for the first serve," Djokovic told the ATP website.
"I thought I found pretty good accuracy and angles with the first serve, and also my second serve worked pretty well.
Overall my game was so-and-so. In the moments when I probably needed to step it up, I did.
Djokovic fired down five aces and faces gave up no break opportunities on his way to the third round, where he will meet either Dominic Thiem or Stefanos Tsitsipas.
Wimbledon
Wimbledon order of play, Day 9 - When are Djokovic, Norrie, and Jabeur playing?
13 HOURS AGO
Wimbledon
'Without Rafa and Novak, Roger could have won 30 Grand Slams' - Wilander
13 HOURS AGO