generate index and per-table output