From: Tom Lane <tgl@sss.pgh.pa.us>
To: depesz@depesz.com
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 10:11:22 -0400
Message-ID: <1349119.1630332682@sss.pgh.pa.us> (raw)
In-Reply-To: <20210830074442.GB15241@depesz.com>
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>
hubert depesz lubaczewski <depesz@depesz.com> writes:
> On Fri, Aug 27, 2021 at 05:23:23PM -0400, Tom Lane wrote:
>> I experimented with the attached, very quick-n-dirty patch to collect
>> format_type results during the initial scan of pg_type, instead.
> So, I applied it to brand new HEAD from git, Result:
> From total of 9173 queries it went down to 4178.
> Originally 5000 type queries, now 19!
> This is actually strange given that previously it was asking querying
> about 83 separate type oids. But, as far as I was able to check with
> "pg_restore -l" (from -Fc dump), results are the same.
Hm. So we're still no wiser than before about how such a small (in
terms of number of objects) database could have produced so many
getFormattedTypeName calls. Plus, this result raises a new question:
with the patch, I think you shouldn't have seen *any* queries of that
form. Where are the 19 survivors coming from?
I don't suppose you could send me a schema-only dump of that
database, off-list? I'm now quite curious.
> But since we're looking at it, and with both patches applied, I looked
> at the next most common query. Which is:
> [ collection of details about a function ]
> 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?)
regards, tom lane
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: tgl@sss.pgh.pa.us, depesz@depesz.com, laurenz.albe@cybertec.at, pgsql-general@lists.postgresql.org
Subject: Re: Can we get rid of repeated queries from pg_dump?
In-Reply-To: <1349119.1630332682@sss.pgh.pa.us>
* 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