pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Can we get rid of repeated queries from pg_dump?
Date: Mon, 30 Aug 2021 16:45:51 +0200
Message-ID: <20210830144551.GA27054@depesz.com> (raw)
In-Reply-To: <1349119.1630332682@sss.pgh.pa.us>
References: <20210826084430.GA26282@depesz.com>
	<648517.1629986527@sss.pgh.pa.us>
	<20210826140827.GA15868@depesz.com>
	<649446.1629987629@sss.pgh.pa.us>
	<20210826160644.GA3120@depesz.com>
	<e6a7503afd115d111fbb96c5787906d73cfe2605.camel@cybertec.at>
	<896732.1630099403@sss.pgh.pa.us>
	<20210830074442.GB15241@depesz.com>
	<1349119.1630332682@sss.pgh.pa.us>

On Mon, Aug 30, 2021 at 10:11:22AM -0400, Tom Lane wrote:
> I don't suppose you could send me a schema-only dump of that
> database, off-list?  I'm now quite curious.

Asked the owners for their permission.

> > The thing is - even though it was called 1804 times, dump contains data only
> > about 107 functions (pg_restore -l schema.dump | grep -c FUNCTION), so it kinda
> > seems that 94% of these calls is not needed.

> Hm.  It's not doing that for *every* row in pg_proc, at least.
> I speculate that it is collecting and then not printing the info
> about functions that are in extensions --- can you check on
> how many there are of those?
> (Actually, if you've got a whole lot of objects inside extensions,
> maybe that explains the 5000 calls?)

Well, not sure if that's a lot, but:
there are 15 extensions, including plpgsql.

SELECT
    count(*)
FROM
    pg_catalog.pg_depend
WHERE
    refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
    AND deptype = 'e';


return 2110 objects:

SELECT
    classid::regclass,
    count(*)
FROM
    pg_catalog.pg_depend
WHERE
    refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
    AND deptype = 'e'
GROUP BY
    1
ORDER BY
    1;

         classid         │ count 
─────────────────────────┼───────
 pg_type                 │    31
 pg_proc                 │  1729
 pg_class                │    61
 pg_foreign_data_wrapper │     1
 pg_cast                 │    30
 pg_language             │     1
 pg_opclass              │    73
 pg_operator             │   111
 pg_opfamily             │    73
(9 rows)

Best regards,

depesz






view thread (37+ messages)  latest in thread

Message-ID: <20210830144551.GA27054@depesz.com>
Permalink:  ../20210830144551.GA27054@depesz.com/
Also on:    postgresql.org/message-id/20210830144551.GA27054@depesz.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, pgsql-general@lists.postgresql.org
  Subject: Re: Can we get rid of repeated queries from pg_dump?
  In-Reply-To: <20210830144551.GA27054@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox