I do suggest taking the painkiller an hour before.
In my experience there was a few times, about 30 seconds each, that (to be perfectly honest) was more than just uncomfortable. It hurt. In my case they had a hard time getting the catheter in. But it was NOTHING like what I read about before going in. At all.
The dye going in was uncomfortable, but nothing huge.
The relief was INSTANT once they were done. Maybe like... super mild cramping for a bit after, but honestly, probably only when I thought about it. But certainly absolutely no PAIN at all once it was over.
Great advice from Kat to bring a pantyliner.... I hadn't thought of that and had to get a pad from the tech. lol.
Just in case it's helpful, here's what will happen, logistically (at least, for me it was, and a few others I've talked to as well):
They will have you on a regular x-ray table, you know, the just regular hard, flat kind. You'll lay near the end, knees up, butt down at the very bottom (some people had stirrup things, I didn't). They catheterize you (this part was painful for me, to be PERFECTLY honest. but nothing intolerable for short periods of time). With catheter in, you have to scoot up the x-ray table to the center. (this part wasn't great, but was more unpleasant than painful). Then the shoot the dye through. (this was a bit crampy, but no biggie)
Most people I've talked to have been able to see the screen (if you tweak your neck) while it happens, which I enjoyed.
good luck! Sometimes people get pregnant RIGHT after an HSG (I'm proof!!! Got my BFP a few weeks later!!!!