I think the relationship is probably better thought about the other way around - not 'How do I best eat to be productive?' but 'How do I best arrange my working day around a good balanced diet? - this gives you the follow on question, which I think is the really important one here, 'How do identify my high and low energy times in my day and schedule appropriate work for them.
Your body is your body and I think we all have to work out what's best for us - on the other hand there are some factors to be aware of.
For example, maximum productivity (particularly in the short term) is not necessarily associated with particularly good health - keeping your sugar levels up is probably good for your productivity, but maybe not if it means you'll gain weight.
Personally I become an unpleasant person if I've not eaten fairly recently and I regularly regret not having stopped work to go and sort out proper food. One of the things I'm working on in my own life is having enough fruit and so on nearby that I'm not always popping out to the shop for a food fix...
When I get the balance right - I'm eating full meals of food I've cooked myself from scratch, at regular times, and being away from my computer while I'm eating them, then my energy levels are up and I get a lot done - but when stress goes up it's very difficult to stick to a careful diet...
Here's an interesting study from the International Labor Organization: Food at work