It's not really an idiom as such, but most people would know what it means.
The 'trough' is a feeding trough - where pigs eat. In western culture, a pig is not considered a polite eater!
So - the idea is (i) that you don't want to miss out on the food, and to a lesser degree (ii) that you are part of a relatively uncivilised group of animals trying to get as much food as possible.