Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJs7E-00026F-20 for pgsql-general@arkaria.postgresql.org; Sat, 28 Aug 2021 06:46:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJs7C-00013m-SH for pgsql-general@arkaria.postgresql.org; Sat, 28 Aug 2021 06:46:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJs7C-00013e-J7 for pgsql-general@lists.postgresql.org; Sat, 28 Aug 2021 06:46:54 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJs7A-00017R-Oe for pgsql-general@lists.postgresql.org; Sat, 28 Aug 2021 06:46:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pB2TPWk5eC48POsOYk9rtZeYa/iJSEFHVzZFydNH0jI=; b=abJCH4uk0CAZXVMVp/ti1s0n/c 896+EjvQzI2ly2CI0x/Ln4S2jdIomjZ/Oorwskm5iDBESroh5GX1LBvPdgFtP6JFjTtHZuSBhrXlu +/DInywN//90YfWs/yBffRmXw/el6ntk660sXe6ojwEk+sCO6h8svzsPJe75NMbzi8CY=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1mJs79-0004oL-1J; Sat, 28 Aug 2021 08:46:51 +0200 Date: Sat, 28 Aug 2021 08:46:50 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Tom Lane Cc: Laurenz Albe , pgsql-general Subject: Re: Can we get rid of repeated queries from pg_dump? Message-ID: <20210828064650.GB11579@depesz.com> Reply-To: depesz@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> <896732.1630099403@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <896732.1630099403@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Aug 27, 2021 at 05:23:23PM -0400, Tom Lane wrote: > Those queries are coming from getFormattedTypeName(), which is used > for function arguments and the like. I'm not quite sure why Hubert > is seeing 5000 such calls in a database with only ~100 functions; > surely they don't all have an average of 50 arguments? Oh. missed that part. So I checked. In the mean time I got -Fc dump, so: #v+ =$ pg_restore -l schema.dump | \ grep -P '^\d*; \d+ \d+ FUNCTION ' | sed 's/^[^(]*(//; s/)[^)]*$//' | awk -F, '{print NF}' | sort -n | uniq -c 23 0 52 1 21 2 8 3 1 4 2 5 #v- 23 functions with 0 arguments, 52 with 1, and the max is 5 arguments - two functions have these. Not sure if it matters but there is a lot of enums. 83 of them. And they have up to 250 elements (2 such types). Best regards, depesz