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 1mJkJs-0001p3-Cc for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 22:27:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJkJr-0002tn-CD for pgsql-general@arkaria.postgresql.org; Fri, 27 Aug 2021 22:27:27 +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 1mJkJr-0002tf-2w for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 22:27:27 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJkJl-0004g4-Co for pgsql-general@lists.postgresql.org; Fri, 27 Aug 2021 22:27:26 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0D1515F799; Fri, 27 Aug 2021 18:27:20 -0400 (EDT) Date: Fri, 27 Aug 2021 18:27:20 -0400 From: Stephen Frost To: Tom Lane Cc: Laurenz Albe , depesz@depesz.com, pgsql-general Subject: Re: Can we get rid of repeated queries from pg_dump? Message-ID: <20210827222720.GV17906@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> <900377.1630103105@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Rd+jWxMEN+3uw23T" Content-Disposition: inline In-Reply-To: <900377.1630103105@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Rd+jWxMEN+3uw23T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > 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 t= he > >> 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. >=20 > > 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. >=20 > 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. Ah, yes, agreed. Thanks! Stephen --Rd+jWxMEN+3uw23T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhKWbIAAoJEO1sijiDR2RVNmQP/R8fuzY2LeFOU40bP16ZW3US qrDdGyeve1RekpDsLpQy4YypbrxPMrh4p/wxdXo5U/WklM/5UWldUAyAK5En2xkj sSbswR66hh2xTKLUHYdwtaEQqFaI/aN5WMhziqVnSFZQqBHXx+hvKetTXZWucpE2 jdsGGV/yaJNybnjJN56Rv7EsZXw3sEyL6qF5ueKlqV12+HJiFzAH1wANOxM3YxPw 9rLcZ/SCJy5zbVaHSHP8a9S5DhLPa6I3C7SC5y7Xh+Bi9wJcrp3K16TXS7VvMiTC YhPhquMfHfeG7EdN9eajhbZ9wzoGCBAgbtWx1hj0jQZe6LgRRXW3/7w4GQwJ7hSc hBW0Ks4RxixgyM9fV8RNwQnOlDbZjMrqTAYaGWGx3MO1UsBjwaF+9myTPTXwzqMZ tYXbOKcniRQ3c0Vtx8F9ME2wbCHncJyHflal3TP4NvIJTJyapDq01K90THzfvsRR Sqg07y2LfGHiHYKqpeXuO9FHU8O2suvGwQZ5WMwXhGa04CLuu4/PMCXhxquObt+k smFNDt05tiu0yD26NBQJrNGaE/pO5b1TTPbCsq62A08H6JwmaaaoS4zAqCetZSEw gYsURqavM/K62nmA9BXmt9//WTOD6bohAfp8hQadbqYegpoS1O6gCTcVIw5U2HDX rcbIl8WyjtEEVJ1A6qrs =lgPj -----END PGP SIGNATURE----- --Rd+jWxMEN+3uw23T--