I too had esophagogastroduodenoscopy and the "sedation" I received as a barely noticeable dose of fentanyl. It was unpleasant to feel like I was drowning in saliva but it was quite bearable.
If I ever receive that procedure again, I will ask to skip the fentanyl microdose. The anesthesia and the buzz were not only underwhelming but for some reasons I started to feel the typical opioid warmth when the procedure was almost completed. Had they waited a few minutes after the IM injection I might have had another opinion on the usefulness on fentanyl during endoscopie because the last 30s were almost pleasant!
FYI, there is an alternative, depending on what you need it for: https://jamiekoufman.com/tne-transnasal-esophagoscopy-is-the...
However, doctors who do it are a bit hard to come by.
With a esophagogastroduodenoscopy, I think the main issue is the gag reflex, not necessarily the pain.