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 1mJGFD-00069o-0L for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 14:20:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJGFB-0001be-Mc for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 14:20:37 +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 1mJGFB-0001bU-ED for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 14:20:37 +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 1mJGF6-0001ot-BZ for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 14:20:36 +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 17QEKT1T649447; Thu, 26 Aug 2021 10:20:29 -0400 From: Tom Lane To: depesz@depesz.com cc: pgsql-general Subject: Re: Can we get rid of repeated queries from pg_dump? In-reply-to: <20210826140827.GA15868@depesz.com> References: <20210826084430.GA26282@depesz.com> <648517.1629986527@sss.pgh.pa.us> <20210826140827.GA15868@depesz.com> Comments: In-reply-to hubert depesz lubaczewski message dated "Thu, 26 Aug 2021 16:08:27 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <649445.1629987629.1@sss.pgh.pa.us> Date: Thu, 26 Aug 2021 10:20:29 -0400 Message-ID: <649446.1629987629@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hubert depesz lubaczewski writes: > On Thu, Aug 26, 2021 at 10:02:07AM -0400, Tom Lane wrote: >> hubert depesz lubaczewski writes: >>> Wouldn't it be possible to get all type formats at once, and cache them >>> in pg_dump? Or at the very least reuse already received information? >> Send a patch ... > Yeah, that's not going to work, my C skills are next-to-none :( > I guess I'll have to wait till someone else will assume it's a problem, > someone with skills to do something about it. Well, you could move it forward by doing the legwork to identify which queries are worth merging. Is it really sane to do a global "select format_type() from pg_type" query and save all the results on the client side? I wonder whether there are cases where that'd be a net loss. You could do the experimentation to figure that out without necessarily having the C skills to make pg_dump actually do it. regards, tom lane