Diabetes patients were once told to avoid sugar.
They still are.
What's changed recently is the understanding that it's necessary for diabetics to avoid eating anything that will raise blood sugar levels above normal.
So researchers came up with a way of putting a number on the speed at which blood sugar rises after eating.
This is called the Glycaemic Index, and it's a bit counter-intuitive.
You say "how much of this food do I need to have eaten 100g of carbohydrate?"
If your food is sugar, a pure carbohydrate, that's about 100g. If it's carrots, which don't contain a great deal, then it's lots and lots.
Then you eat that much.
Then you see how fast your blood sugar rises. That speed is called the GI.
This leads to some very strange results, and should be treated with care.
For instance, watermelons don't contain many carbs, so you have to eat far more watermelon than would be reasonable.
If you do, then you actually produce quite a sugar shock! So watermelons have a high GI.
But that doesn't mean that eating watermelon leads to sugar shock. Quite the reverse. You'd normally eat them in reasonable amounts. They don't contain many carbs. Therefore they don't cause sugar shock.
To cause a sugar shock, you need both a high GI and a high carbohydrate content.
With that caveat, which foods are likely to cause sugar shock?
Sugar (not quite a no-brainer, since blood sugar and table sugar are different things)
There are others, but these are the big dangers, simply because our modern diet is full of them.
Three of them are derivatives of wheat, which is a recent domesticated form of grass probably not more than a few thousand years old.
Rice is another form of grass which has been domesticated, and over the years made to produce huge edible seeds.
Potatoes came from the New World. No human being or human ancestor ate them until the first Americans, and we're not descended from them. My ancestors first met the potato about three hundred years ago.
Sugar is a highly processed product. I doubt there was much around in the diet of our hunter-gatherer forebears.
Our distant ancestors would not have eaten anything like these things. Those of us who are descended from farmers have recent ancestors who have eaten them, so we can deal with them, but not very well.