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 1kCnaD-0006JT-Aj for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2020 17:27:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kCnaC-0003ez-49 for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2020 17:27:04 +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 1kCnaB-0003es-TR for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2020 17:27:03 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kCna9-0005xu-E8 for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2020 17:27:02 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 614D25F79F; Mon, 31 Aug 2020 13:26:59 -0400 (EDT) Date: Mon, 31 Aug 2020 13:26:59 -0400 From: Stephen Frost To: Bruce Momjian Cc: Tom Lane , Andrey Lepikhov , pgsql-hackers@lists.postgresql.org, Etsuro Fujita , Jeff Janes Subject: Re: Ideas about a better API for postgres_fdw remote estimates Message-ID: <20200831172659.GS29590@tamriel.snowman.net> References: <20200706152828.GG3125@tamriel.snowman.net> <20200714013219.GD32422@momjian.us> <7a40707d-1758-85a2-7bb1-6e5775518e64@postgrespro.ru> <20200829162231.GE29590@tamriel.snowman.net> <3565504.1598719859@sss.pgh.pa.us> <20200831161455.GD13613@momjian.us> <20200831161952.GQ29590@tamriel.snowman.net> <20200831164725.GE13613@momjian.us> <20200831165621.GR29590@tamriel.snowman.net> <20200831170817.GF13613@momjian.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YCRcJblGSeMKc270" Content-Disposition: inline In-Reply-To: <20200831170817.GF13613@momjian.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --YCRcJblGSeMKc270 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Bruce Momjian (bruce@momjian.us) wrote: > On Mon, Aug 31, 2020 at 12:56:21PM -0400, Stephen Frost wrote: > > The point I was making was that it has value and people did realize it > > but there's only so many resources to go around when it comes to hacking > > on PG and therefore it simply hasn't been done yet. > >=20 > > There's a big difference between "yes, we all agree that would be good > > to have, but no one has had time to work on it" and "we don't think this > > is worth having because of the maintenance work it'd require." The > > latter shuts down anyone thinking of working on it, which is why I said > > anything. >=20 > I actually don't know which statement above is correct, because of the > "forever" maintenance. I can understand not being sure which is correct, and we can all have different points of view on it too, but that's a much softer stance than what I, at least, understood from your up-thread comment which was- > I don't think there was enough value to do statistics migration just > for pg_upgrade [...] That statement came across to me as saying the latter statement above. Perhaps that wasn't what you intended it to, in which case it's good to have the discussion and clarify it, for others who might be following this thread and wondering if they should consider working on this area of the code or not. > Yes, very true, but technically any change in any aspect of the > statistics system would require modification of the statistics dump, > which usually isn't required for most feature changes. Feature work either requires changes to pg_dump, or not. I agree that features which don't require pg_dump changes are definitionally less work than features which do (presuming the rest of the feature is the same in both cases) but that isn't a justification to not have pg_dump support in cases where it's expected- we just don't currently expect it for statistics (which is a rather odd exception when you consider that nearly everything else that ends up in the catalog tables is included). For my part, at least, I'd like to see us change that expectation, for a number of reasons: - pg_upgrade could leverage it and reduce downtime and/or confusion for users who are upgrading and dealing with poor statistics or no statistics for however long after the upgrade - Tables restored wouldn't require an ANALYZE to get reasonable queries against them - Debugging query plans would be a lot less guess-work or having to ask the user to export the statistics by hand from the catalog and then having to hand-hack them in to try and reproduce what's happening, particularly when re-running an analyze ends up giving different results, which isn't uncommon for edge cases - The postgres_fdw would be able to leverage this, as discussed earlier on in this thread - Logical replication could potentially leverage the existing stats and not require ANALYZE to be done after an import, leading to more predictable query plans on the replica I suspect there's probably other benefits than the ones above, but these all seem pretty valuable to me. Thanks, Stephen --YCRcJblGSeMKc270 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJfTTLiAAoJEO1sijiDR2RViJ4QAJCxSF1uPoVQDm4bPMjdKies X54USJ+6MHbmmOmjyJcBjWUpdMogTfK3Jy/wCuFV0d/gzzSC/TG5TQ4Hmj6VVi5J JY8ywObZK2nBeenwtnSE1GOr3/WT3ZydZW8YJNu+EHTPdnrEIvvkuWNA015IgSrD TAyzFGtUeoX20VG1zDLDC3I3Q5rRNCIjP18Z3xkiN8oJ3qXUdyH7pXX4BqPUFjHZ MWvy0PP1exqRQS2JYQNpq5Q33uMGvICQtfcDZBOKSgPIfUr3yv9Z9P/TbHx8Tbff D/Xwoz5wtlXnyZzTtMFBFtQbNUzeBmH5GZf9QJkIFgBz8Nb+TOoaJJsR/D6NFtSo q6OX2nCJkUXQQnwan+oc92MenF3n409/Da/zfQw3Syt3cIvtmslln1R55JRMlIeM EXOPCFaorAnUaNl1Nhr26CRgiQ0rDivegeW9NpN7dNV1qw2wxoTZ3QbHfHxBAvzO jGgETOt8CU3cN/nI8n4nz9abe/hVXr6DlpckWfKGAME9Alpix2EbzSbmAu52VWBH 4+DAjNn88BR+IEydBwNgIBzb18XbY5x2oaCYlLx3JZDX/Sqb+9jDkzP2+dM07t0M DprOnYiCdpHPACufzafsvQ+tJ6fDqeqip4maPXhTvmzrMEQuxZEyjZjr6v8cADOj YgbSBcf8VUTLXyZk/vKk =5Fbc -----END PGP SIGNATURE----- --YCRcJblGSeMKc270--