use a set to keep track of the tables we need to analyze. Perform the analysis after we have committed the main transaction, so we don't hold table locks for any longer than necessary.