I'm trying to find a simple solution (smart search), rather than downloading my whole big accumulated mess and create a program to parse it. Of course after deleting the offending messages, I could download a smaller backup of my inbox. Then I could say good bye to Gmail.
You could try a Google app script and log everything to a Google spreadsheet. Will probably take a long time to run, but should be easy enough to set up.