Re: Partial aggregates pushdown - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Partial aggregates pushdown
Date
Msg-id ZDF3DFdMEL7xkngp@momjian.us
Whole thread Raw
In response to Re: Partial aggregates pushdown  (Andres Freund <andres@anarazel.de>)
Responses Re: Partial aggregates pushdown  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Fri, Apr  7, 2023 at 09:16:14PM -0700, Andres Freund wrote:
> On 2023-04-07 22:53:53 -0400, Bruce Momjian wrote:
> > > postgres_fdw has no business pushing down calls to non-builtin functions
> > > unless the user has explicitly authorized that via the existing
> > > whitelisting mechanism.  I think you're reinventing the wheel,
> > > and not very well.
> > 
> > The patch has you assign an option at CREATE AGGREGATE time if it can do
> > push down, and postgres_fdw checks that.  What whitelisting mechanism
> > are you talking about?  async_capable?
> 
> extensions (string)
> 
>     This option is a comma-separated list of names of PostgreSQL extensions that are installed, in compatible
versions,on both the local and remote servers. Functions and operators that are immutable and belong to a listed
extensionwill be considered shippable to the remote server. This option can only be specified for foreign servers, not
per-table.
> 
>     When using the extensions option, it is the user's responsibility that the listed extensions exist and behave
identicallyon both the local and remote servers. Otherwise, remote queries may fail or behave unexpectedly.
 

Okay, this is very helpful --- it is exactly the issue we are dealing
with --- how can we know if partial aggregate functions exists on the
remote server.  (I knew I was going to need API help on this.)

So, let's remove the PARTIALAGG_MINVERSION option from the patch and
just make it automatic --- we push down builtin partial aggregates if
the remote server is the same or newer _major_ version than the sending
server.  For extensions, if people have older extensions on the same or
newer foreign servers, they can adjust 'extensions' above.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Embrace your flaws.  They make you human, rather than perfect,
  which you will never be.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making background psql nicer to use in tap tests
Next
From: Matthias van de Meent
Date:
Subject: Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths