Another use case of the Index Advisor is to be switched on for a few hours while the application runs, and gather the recommendations for the whole run. We'll need good performance that case too.
How exactly does that work? I would imagine that you log all the different SQL statements and how often they're run during that period. Similar to pgFouine, for example. And only then you run the index advisor on the collected SQL statements.
The Index Advisor produces recommendations for every running query on the fly and stores them in a table. After the application run is over, these recommendations can be viewed in the table and analyzed to pick the indexes that provide the most benefit.