With a headshim you are lowering the compression on your motor which allows you to run more power on a lower octane fuel.
You would be looking at a lot of $ for a headshim install as the motor basically needs to be pulled. A cheaper route to run lower octane/eliminate detonation is a meth install kit which is another story.