My rule is to eat and drink as little as possible before a flight, ideally not eating at all. If I do eat, hopefully it's high protein and low in fiber. As a result I usually don't need to use the lavatory, which is nice because it has made me much less apprehensive about getting a window seat.
I wish more people had this mindset. On so many flights I've had, seemingly half the plane is ready to take a shit. My only explanation is that they're overnourished on the Standard American Diet. Imagine how much less waste would have to be pumped out of airplanes.