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 1mJkHk-0001km-IP for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 22:25:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJkHi-0006OF-KF for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 22:25:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJkHi-0006O7-AN for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 22:25:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJkHf-0004f7-Ss for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 22:25:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17RMP5Fx900378; Fri, 27 Aug 2021 18:25:05 -0400 From: Tom Lane To: Stephen Frost cc: Laurenz Albe , depesz@depesz.com, pgsql-general Subject: Re: Can we get rid of repeated queries from pg_dump? In-reply-to: <20210827215836.GT17906@tamriel.snowman.net> 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> <20210827215836.GT17906@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Fri, 27 Aug 2021 17:58:36 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <900376.1630103105.1@sss.pgh.pa.us> Date: Fri, 27 Aug 2021 18:25:05 -0400 Message-ID: <900377.1630103105@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> I experimented with the attached, very quick-n-dirty patch to collect >> format_type results during the initial scan of pg_type, instead. On the >> regression database in HEAD, it reduces the number of queries pg_dump >> issues from 3260 to 2905; but I'm having a hard time detecting any net >> performance change. > Seems like the issue here is mainly just the latency of each query being > rather high compared to most use-cases, so local testing where there's > basically zero latency wouldn't see any change in timing, but throw a > trans-atlantic or worse amount of latency between the system running > pg_dump and the PG server and you'd see notable wall-clock savings in > time. Yeah. What I was more concerned about was the potential downside of running format_type() for each pg_type row, even though we might use only a few of those results. The fact that I'm *not* seeing a performance hit with a local server is encouraging from that standpoint. regards, tom lane