For the sake of those who don't know, the US calculates octane rating different than the EU and most of the rest of the world.
UK/EU "95"octane = is about 90/91 octane in the USA
UK/EU "super" "97-99"octane = is about 92/93 octane in the USA
Pinging(knocking/detonation/spark knock/etc.) will normally only occur when the motor is usually under a substantial load and and accelerating. Left unchecked it can quickly destroy a motor if severe enough. It can easily break the ring lands off the piston. Many modern engines have "knock" detectors which usually just retard timing to lessen/eliminate the pinging. If you here it for more than about a tenth of a second and it hasn't lessened let off the throttle. As soon as I hear ANY I get off the throttle ASAP.
I can't tell you how many motors I've seen destroyed from knocking becoming severe. Usually it is a turbo motor but others can be destroyed as well. If you hear loud knocking, imagine a giant sledgehammer whacking the gophers head as it comes up through the hole. That is like what is happening to your piston at that moment. If it sounds like a diesel, and it isn't one, look out. Better safe than sorry.
So you want enough octane to have no detonation (knocking) but any more than that is pretty much a waster. Octane does depend on altitude as well. At higher altitudes (in normally aspirated motors [non-turbo]) you can usually get by with lower octane. If a turbo is referenced to absolute pressure then you better make sure you get it the octane it needs at sea level.