Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7z13-007iZK-PC for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2023 14:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r7z12-005RAQ-8J for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Nov 2023 14:24:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7z11-005RA9-JW for pgsql-hackers@lists.postgresql.org; Tue, 28 Nov 2023 14:24:43 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7z0w-008ywN-C4 for pgsql-hackers@postgresql.org; Tue, 28 Nov 2023 14:24:42 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id ECDA95F7BA; Tue, 28 Nov 2023 09:24:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snowman.net; s=dkim; t=1701181471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y0Qg26DaFX7NpttPPo0WCyK7kNIpNXrRCw2jA97l1ag=; b=wUMJLhOtuqbGX5YF2W9DcywI44mOo18G7RxzYsFMJQtvGfpwwvBu4wub0dmDVvKN0FNyDU GhTcl//roEwOpdAau5g7681iCIAlhA7fXHniC39AdoDOAIO/qKrqX533OotPoHf35fDxOv PTy68ywQWIr/bsVVgAyVY1k3s5ze0rs= Date: Tue, 28 Nov 2023 09:24:31 -0500 From: Stephen Frost To: Robert Haas Cc: Tom Lane , "Fujii.Yuki@df.MitsubishiElectric.co.jp" , Alexander Pyhalov , Bruce Momjian , PostgreSQL-development , "Finnerty, Jim" , Andres Freund , Tomas Vondra , Julien Rouhaud , Daniel Gustafsson Subject: Re: Partial aggregates pushdown Message-ID: References: <8175ddeb6d417d8a1f91e667fef77abf@postgrespro.ru> <4012625.1701120204@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0s3wE3IR80WWNjTU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0s3wE3IR80WWNjTU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Robert Haas (robertmhaas@gmail.com) wrote: > On Mon, Nov 27, 2023 at 4:23=E2=80=AFPM Tom Lane wrot= e: > > Well, one of the founding principles of postgres_fdw was to be able > > to talk to PG servers that are not of the same version as yours. > > If we break that in the name of performance, we are going to have > > a lot of unhappy users. Even the ones who do get the benefit of > > the speedup are going to be unhappy when it breaks because they > > didn't upgrade local and remote at exactly the same time. >=20 > I agree with this. +1. We do want to continue to make this work- to the extent possible. I don't think there's any problem with saying that when talking to an older server, you don't get the same capabilities as you do when talking to a newer server. > > Just because we'd like to have it doesn't make the patch workable > > in the real world. >=20 > And also with this in concept - I'd like to plan arbitrarily > complicated queries perfectly and near-instantly, and then execute > them at faster-than-light speed, but we can't. However, I don't > understand the fatalism with respect to the feature at hand. As I said > before, it's not like no other product has made this work. Sure, some > of those products may not have the extensible system of data types > that we do, or may not care about cross-version communication, but > those don't seem like good enough reasons to just immediately give up. Certainly there are other projects out there which are based on PG that have managed to make this work and work really quite well. > TBH, I suspect even some PG forks have made this work, like maybe PGXC > or PGXL, although I don't know for certain. We might not like the > trade-offs they made to get there, but we haven't even talked through > possible design ideas yet, so it seems way too early to give up. Yes, Citus[1] and Greenplum[2], to just name two. I certainly understand the concern around the security of this and would have thought the approach we'd use would be to not just take internal state and pass it along but rather to provide a way for aggregates to opt-in to supporting this and have them serialize/deserialize with new dedicated functions that have appropriate checks to avoid bad things happening. That could also be versioned, perhaps, if we feel that's necessary (I'm a bit skeptical, but it would hopefully address the concern about different versions having different data that they want to pass along). > One of the things that I think is a problem in this area is that the > ways we have to configure FDW connections are just not very rich. Agreed. > We're trying to cram everything into a set of strings that can be > attached to the foreign server or the user mapping, but that's not a > very good fit for something like how all the local SQL functions that > might exist map onto all of the remote SQL functions that might exist. > Now you might well say that we don't want the act of configuring a > foreign data wrapper to be insanely complicated, and I would agree > with that. But, on the other hand, as Larry Wall once said, a good > programming language makes simple things simple and complicated things > possible. I think our current configuration system is only > accomplishing the first of those goals. We've already got issues in this area with extensions- there's no way for a user to say what version of an extension exists on the remote side and no way for an extension to do anything different based on that information. Perhaps we could work on a solution to both of these issues, but at the least I don't see holding back on this effort for a problem that already exists but which we've happily accepted because of the benefit it provides, like being able to push-down postgis bounding box conditionals to allow for indexed lookups. Thanks, Stephen [1]: https://docs.citusdata.com/en/v11.1/develop/reference_sql.html [2]: https://postgresconf.org/conferences/Beijing/program/proposals/impleme= ntation-of-distributed-aggregation-in-greenplum --0s3wE3IR80WWNjTU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwf6gbxKhD863zrx/7WyKOINHZFUFAmVl+BwACgkQ7WyKOINH ZFX4Og/+J7iIHkmwo8og2qZts8yqBoZLo3rCTRYq1Xs7J+D71/QeYWSDnNGmiVGP yXOnq9GZAJBHXnQiqHyt1SpnFyCSVkJkjVfSFT54RsU+1m0pf5ZGcoBmGG8jrqWF 5f1lTDhy0O3Ynj/83D+mza7zgLSpmLIx/229jUgt2+YuTJdRXIBwrlI6yexOlN/q qcXIJuDBpntf9FjtpXBJsy3IGYimOJX6d82tvouAvRgR3wBL0jHvHc24inawZxEU BbufTQkSHb1tQaB83DQjVHnxQTd9rWXO+7wJCECeJlc1UWnU8xzwL7hV0ORTaidr ANkefTuuSqZOUhuTqlRe90XbgK82jrMr/rmzGYPUFSbFbVxVoN+4kb2+Neebs1l+ AdXecZeAQaDpEPs6Z7/1Gz5tjFXVRywyxiwP1dgS3Aga7rGZPMpP45lU1caDiNeO rrAGWNG4Nhgz4zkBML2n/MIc71YvuCQpqEv+brpEsu9n1cJEf02Tt2tVCJnmymCp 4ZVZR/jDdCcE3RlmYCyD4qpTeLkiGxfeQYoXYicLCsEuzr8JB9F82xQG44Rf1OjP CYtPwq2hTaAoa5QzRz5nzzJ6RQ2j6D8RnDQZOGtwoInXIJSFX6pHzKyK4bvABlL6 N2BxP6tWC5xwq2Qr4Mdo78yfh4sWaGJ5ErN8C025hhffexRn2Vk= =w22G -----END PGP SIGNATURE----- --0s3wE3IR80WWNjTU--