I'm trying to understand this song from a compositional standpoint, but I'm just not getting it. I am sure the song starts out in F major as the Bb, C, and D chords give that away. However, before the solo there is that fast run which I am sure is in G major. The part that confuses me is the actual solo. I am not sure if it's in G minor or D minor. G minor would make sense because the major to minor key change is quite common. Then again, D minor would make sense because the song started in F major and D minor is the relative minor. I don't claim to be an expert on this stuff, and I could be way off in what I've said, but it's made sense thus far to me so I've stuck with it. What confuses me is that I know Slash raises and lowers various notes of the major scale, as well as plays the blues notes, and harmonic minor notes. However, if you change too many you'll be in a completely different key. I don't know. Any help would be appreciated.

P.S. If you know the key changes in GNR's Coma that's one that has me hung up too.