On Mon, 2025-02-24 at 09:54 -0500, Andres Freund wrote: > ISTM that we ought to expose the relation oid in pg_stats. This query > would be > simpler and faster if we could just use the oid as the predicate. > Will take a > while till we can rely on that, but still.
+1. Maybe an internal view that exposes only starelid/staattnum, and pg_stats could just be a simple join on top of that? There's another annoyance, which is that pg_stats doesn't expose any custom stakinds, so we lose those, but I'm not sure if that's worth trying to fix. Regards, Jeff Davis