Have you tried with JIT turned off in PG12? The long running node is ProjectSet type which is related to set returning functions. If that is getting evaluated differently in PG12, that may be issue.
- information_schema performance in Postgres 12 Eric Gillum
- Re: information_schema performance in Postgres 12 Adrian Klaver
- Re: information_schema performance in Postgres 12 Eric Gillum
- Re: information_schema performance in Postgres ... Michael Lewis
- Re: information_schema performance in Postg... Eric Gillum