pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

pgschema dump is really slow on my machine

Open marcintustin opened this issue 9 months ago • 1 comments

~/dev/repos/clientdatamart 🌳BVGS-1741$ pgschema --debug dump --host host.co --db dib --user marcintustin --schema public --file schemas/public/main.sql --multi-file
time=2026-02-10T14:25:17.379-05:00 level=DEBUG msg="Attempting database connection" host=host.co port=5432 database=dib user=marcintustin sslmode=prefer application_name=pgschema
time=2026-02-10T14:25:17.896-05:00 level=DEBUG msg="Database connection established successfully"

This hangs. I can see that all queries are idle. The last queries were GetAggregatesForSchema and select rolname from pg_roles where oid=$1;

Some kind of very verbose logging mode might help diagnose this. Please?!

Edit: Most recent attempt succeeded after 8 minutes. Edit 2: Using v1.7.0. Edit 3: Maybe some option to capture profile data using pprof? Edit 4: using v.1.6.1 it took 8m26.446s (real) so this isn't a performance regression in the most recent version. I can only assume that IT have found a way to make this really slow in the name of security.

marcintustin avatar Feb 10 '26 19:02 marcintustin

  1. How big is your schema?
  2. What's the latency between where pgschema runs and the db?

tianzhou avatar Feb 14 '26 15:02 tianzhou