The best than can be determined is that it's an Amercanism originating around 1850 or so. It was proceeded by "Sweating like a bull", which, at least, has some reference in actuallity, but pigs do not sweat since they have no sweat glands. Seems it's just a phrase that has no real meaning within itself, but everyone knows it means profuse prespiration... Sorry I couldn't be more deffinitive... Perhaps the venerable Q will have more insight (He has one of the biggest OED's in existence... his own private edition...)