• Robbie Ray on his outing vs. Padres

    Robbie Ray on his outing vs. Padres

  • Manager Torey Lovullo on D-Backs' win, Bradley's save

    Manager Torey Lovullo on D-Backs’ win, Bradley’s save

  • Diamondbacks react to 'tough' loss to Padres

    Diamondbacks react to ‘tough’ loss to Padres

  • Coyotes take batting practice at Chase Field

    Coyotes take batting practice at Chase Field

  • Torey Lovullo on the end of the D-Backs' win streak

    Torey Lovullo on the end of the D-Backs’ win streak

  • Paul Goldschmidt says his elbow is structurally sound

    Paul Goldschmidt says his elbow is structurally sound

  • Zack Greinke after D-Backs' win over Dodgers

    Zack Greinke after D-Backs’ win over Dodgers

  • Torey Lovullo on D-Backs' record-tying 12th consecutive win

    Torey Lovullo on D-Backs’ record-tying 12th consecutive win

  • Shot Clock: JD rocks LA; Cards chase Seattle

    Shot Clock: JD rocks LA; Cards chase Seattle

  • J.D. Martinez on his four-homer night vs. Dodgers

    J.D. Martinez on his four-homer night vs. Dodgers

  • Paul Goldschmidt talks about his sore right elbow

    Paul Goldschmidt talks about his sore right elbow

  • Torey Lovullo on J.D. Martinez's four-homer performance

    Torey Lovullo on J.D. Martinez’s four-homer performance

  • Robbie Ray after striking out career-high 14 vs. Dodgers

    Robbie Ray after striking out career-high 14 vs. Dodgers

  • Torey Lovullo on D-Backs' 10th consecutive win

    Torey Lovullo on D-Backs’ 10th consecutive win

  • Zack Godley on wild yet effective outing vs. Rockies

    Zack Godley on wild yet effective outing vs. Rockies

  • Patrick Corbin on D-Backs' nine-game win streak

    Patrick Corbin on D-Backs’ nine-game win streak

  • Chris Herrmann on Corbin's outing, D-Backs' leads

    Chris Herrmann on Corbin’s outing, D-Backs’ leads

  • Taijuan Walker on his outing vs. Rockies

    Taijuan Walker on his outing vs. Rockies

  • Torey Lovullo after D-Backs' eighth consecutive win

    Torey Lovullo after D-Backs’ eighth consecutive win

  • Diamondbacks sweep Dodgers

    Diamondbacks sweep Dodgers

  • Robbie Ray on his performance against Dodgers

    Robbie Ray on his performance against Dodgers

  • Torey Lovullo on win over Dodgers

    Torey Lovullo on win over Dodgers

  • Diamondbacks hold off Dodgers for 7-6 win

    Diamondbacks hold off Dodgers for 7-6 win

  • Paul Goldschmidt on D-Backs' big inning vs. Giants

    Paul Goldschmidt on D-Backs’ big inning vs. Giants

  • Goldschmidt on three-run HR in D-Backs' win

    Goldschmidt on three-run HR in D-Backs’ win

  • Lovullo on Corbin, offense in D-Backs' win

    Lovullo on Corbin, offense in D-Backs’ win

  • Lovullo on D-Backs' win over Giants

    Lovullo on D-Backs’ win over Giants

  • Diamondbacks pitcher Robbie Ray on his return vs. the Mets

    Diamondbacks pitcher Robbie Ray on his return vs. the Mets

  • Torey Lovullo on Robbie Ray's return vs. Mets

    Torey Lovullo on Robbie Ray’s return vs. Mets

  • Torey Lovullo on missed opportunities in loss to Mets

    Torey Lovullo on missed opportunities in loss to Mets

  • Zack Godley on his outing vs. Mets

    Zack Godley on his outing vs. Mets

  • Patrick Corbin on his third straight strong outing

    Patrick Corbin on his third straight strong outing

  • Torey Lovullo talks about Patrick Corbin's latest gem

    Torey Lovullo talks about Patrick Corbin’s latest gem

  • A.J. Pollock on his go-ahead homer in D-Backs' win over Mets

    A.J. Pollock on his go-ahead homer in D-Backs’ win over Mets

In recent weeks, the Diamondbacks offense has been hindered by deficiencies. Jake Lamb has slumped. A.J. Pollock has been inconsistent. David Peralta has leveled out. And Paul Goldschmidt has been hurt.

J.D. Martinez, meanwhile, has been a savior. Martinez slammed two more home runs on Sunday afternoon, one to tie the game early, the other to provide a lead late, and the Diamondbacks slipped past the San Diego Padres 3-2 at Chase Field, avoiding a three-game sweep.

The home runs were the 20th and 21st for Martinez since joining the Diamondbacks in a July 18 trade with the Detroit Tigers. His impact has been sizable enough to spark conversation of where his performance ranks among other midseason acquisitions in baseball history.

It’s also been good enough to inspire daydreaming fans to imagine his stay with the Diamondbacks lasting longer than just three months. It’s hard to blame them: The thought of where the Diamondbacks would be without him in recent weeks leads naturally to the thought of what will happen next year if he departs as a free agent.

“He’s been huge,” said left-hander Robbie Ray, who struck out 12 and gave up two runs in six innings. “Not only what you see out there, but protection for (Goldschmidt). Guys have to throw to him because J.D. is right behind him. It’s just changed the whole dynamic of our lineup.”

Said manager Torey Lovullo: “He’s carried us and helped us win a number of games. He’s come more than advertised. He’s been outstanding in just about any way you can imagine.”

In 45 games since the trade, Martinez has hit .269 with a .342 on-base and .701 slugging. He’s hit key home runs. He’s driven in important runs. He’s done everything the Diamondbacks could have hoped.

“I don’t know the history of baseball, but I think you can put him up there as one of the best midseason trades that’s ever been made,” reliever Archie Bradley said. “The guy is incredible. Every homer is getting more expensive. Hopefully, he likes us a lot and wants to stay here.”

In terms of impact, Martinez’s compares to just about any hitter moved at the trade deadline in recent years. There are two who stand out, both of whom changed teams before the deadline in 2008.

That year, Mark Teixeira went from the Braves to the Angels and went on to hit .358 with 13 homers and a 1.081 OPS (on-base-plus-slugging). Three days later, the Dodgers acquired Manny Ramirez, who proceeded to hit .396 with 17 homers and a 1.232 OPS.

“It feels awesome,” Martinez said. “That’s what I wanted to do. I wanted to come here and help out any way I can. It’s a great team here. So just being here and being able to contribute is huge.”

The win was a bounce-back from Saturday night’s ugly loss, in which they blew a five-run cushion in the ninth by allowing six runs to fall 8-7.

“I don’t think anyone took the loss yesterday too hard, but obviously it stung a little bit,” said Bradley, who earned his first career save on Sunday. “The way we’ve been playing baseball and to drop the two games the way we did, we wanted to get back on track, save the series and not get swept. That’s what we did today.”

The win also allowed them to maintain their five-game lead over the Colorado Rockies for the top wild-card spot while gaining yet another game on the plummeting Dodgers, who have lost 10 consecutive games yet still own a nine-game lead in the National League West.

The Diamondbacks open a four-game series against the Rockies on Monday night at Chase Field.

Related: Torey Lovullo’s decisions come under scrutiny

More: Could reliever Jimmie Sherfy make way onto postseason roster?

Unlucky 13: Winning streak comes to an end

Autoplay

Show Thumbnails

Show Captions

Reach Piecoro at (602) 444-8680 or [email protected]. Follow him on Twitter @nickpiecoro.