First of all, it's justice, that's what matters, as for the deterrent, I lived in Colorado and this was a story there:
en.wikipedia.org
sentenced to death by
lethal injection on May 17, 1996
Dunlap's death sentence was commuted to life in prison without parole in 2020 after Colorado abolished the death penalty
Yep, many people who knew about the story were dead by then, that is 24 years. Are you fucking kidding me, why does it take so long? This is the problem, for it to be a detterent it needs to be given (it rarely is) and it needs to be executed (it rarely is) so stop with the bs about it's not a deterrent.
If you want to know if it's a detternet, just ask prisoners do you want jail or death, if they choose death execute them on the spot. How many will choose it?