I don't think that any sentencing policy has a deterrant effect prior to the commission of a crime. the very idea that it could have is a kind of fallacy - let me explain.
I have always thought that criminals fall into two categories. The first category are those who commit a crime (especially a crime of violence, including murder) in the heat of some type of moment - anger, fear, frustration, the influence of drink or drugs, etc.
They are really thinking about what they are doing at all before they do it, and if they did, they probably would stop short. Therefore, any kind of rational analysis of what might happen to them afterwards is nowhere near their decision making process, because no such process consciously exists.
In such circumstances of an "impulse" crime, there is no possibility of ANY deterrant to the comission of the crime, though often such criminals calm down enough afterwards to attempt to evade detection (hiding or removing evidence, intimidating witnesses, etc.)
The other sort of criminal is one that does pre-plan their crime, and have the time to consider possible consequences - any deterrant effect can only take place in such circumstances, I would argue.
In weighing up the pros and cons, I would think that the most important deterrant to the commission of a serious crime is not the possible sentence, but the
likelihood of detection. It then escalates from there, with the possible sentence being the
last thing you'd consider.
This is especially ture of so-called "professional" criminals in "serious" crimes - for a minor theft, they might view jail time as an occupational hazard, and consider it worth the risk even if they are caught stealing to do a couple of years. If they are planning to kill someone, they will
know that they could be killed themselves or spend decades in jail, and I don't think any criminal will think of decades in jail as an easy option. (Unless of course they just don't care what happens to them, in which case the deterrant effect is again lost.)
Being caught is much more of a deterrant to murder than being sentenced to death
if you're caught AND tried AND found guilty AND your appeals are all rejected.
If you think you have done enough to avoid being questioned in the first place, you don't have to think about what might happen if you are arrested. If you think you have done enough to avoid being arrested (e.g. given a plausible enough alibi) you won't worry about what might happen if you're prosecuted. If you think you have done, or can do, enough to bargain your plea down to a lesser offence or sentence, you don't worry about what will happen IF you get convicted by a jury.
In short, people only commit crimes if they think they can get away with them, or if they don't
think about them
at all. In neither case does the possible sentence deter anyone. Now, in reality, the distribution of IQs among criminals is about the same as the general population, if even a little lower, so most murderers do get caught. Even very smart criminals have the disadvantage that there's only one of them and many more people in law enforcement. (The very smartest criminals are never caught or even detected.)
But where does the fallacy kick in? Well, for law abiding citizens, the death penalty (and prison itself) is a deterrant. We might sometimes get angry enough to want to kill someone, but instantly dismiss the notion. I don't believe we do that because of the possible consequences, we do it because it's just plain wrong.
In the worldview of a law-abiding person, the penalty (be it death or "life") may be a deterrant, because it is an outcome that the law-abiding rationale not only foresees but expects.
My argument is that, in the worldview of a criminal, the whole justice system is either something that is ignored completely - because the criminal is behaving irrationally anyway - or something that can be mitigated or avoided altogether - in which case it doesn't much matter what happens IF it isn't.
Any other explanation seems to view every single human being as a would-be criminal who only refrains from murder and all manner of other crimes from fear of what might happen if he did got caught for it, and I refuse to believe that we are all so venal. (The thought experiment of "if you were completely alone in a God-proof room, with someone you hate, and knew you could get away scot free if you killed them, would you do it?" springs to mind.)
The death penalty is no deterrant even o those on death row - they simply don't have the opportunities to kill someone that the general prison population does, let alone people on the outside. It's not deterrance, it's physical prevention, and the ultimate physical prevention is death.
The other reasons usually given for any kind of sentence are as an example to others (which is effectively the same as the deterrant argument I believe is so flawed), rehabilitation (clearly, for the death penalty, this does not apply, barring reincarnation

), and punishment. I don't believe the dead can suffer, and nobody
knows that they do, so this is a weak basis for a system of justice.
Which only leaves revenge, which I believe is the only real reason the death penalty exists.
In a small number of cases, I would support the death penalty, if only I could be sure that no wrongly-convicted men and women would ever be executed. Since I know from the number of posthumous pardons this is not the case(the UK, when it had the death penalty, didn't have the ponderous multiple appeals system you have in the USA, and even with that you get it wrong sometimes), I cannot and will not support the death penalty.