This obviously shouldn't been for all databases and all snapshots, so some heuristics will have to be added to know when to perform that. Some ideas for that:
Cache the current ShmemVariableCache->nextOid for each server and the highest recorded oid found in each database
let user ask for refreshing that data from the UI, propagated to the collector
use ProcessUtility_hook to detect when handled objects have been created or dropped
Naive initial list:
This obviously shouldn't been for all databases and all snapshots, so some heuristics will have to be added to know when to perform that. Some ideas for that: