Re: How can I pushdown of functions used in targetlist with FDW ?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: sfrost(at)snowman(dot)net, shigeo(dot)hirose(at)toshiba(dot)co(dot)jp, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How can I pushdown of functions used in targetlist with FDW ?
Date: 2020-01-10 03:24:12
Message-ID: 20200110.122412.1439006737247514900.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At Thu, 09 Jan 2020 20:25:20 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in
> Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> writes:
> > Isn't ROUTING MAPPING [1] that? Definers should define one at their
> > own risk as table constraints are.
>
> Hmm. It looks like that patch is moribund, and I can't say that I'm
> excited about reviving it. Aside from the syntactical reserved-word
> problems, it seems like a mighty heavyweight way of attacking the issue

I don't mean that the patch itself is usable right now, but am simply
asking about the feature.

> --- that is, instead of a property directly attached to the function of
> interest, you've now got this entire other system catalog structure that
> has to be searched for relevant information. And that needs all the usual
> support for a new object type, eg ALTER infrastructure, pg_dump support,
> etc etc etc.

Yeah, that sounds really combersome to me..

> Plus, once you've created a mapping, it's only good for one server so you
> have to do it over again for each server. I guess in the general case
> you have to have that, but I'd sure want some kind of shortcut for the
> common case where e.g. ABS() means the same thing everywhere.

As for the user side, I understand that they want to push down certain
functions despite of the troubles, but it's better if simpler.

About the idea of function attrributes, I think push-down'ability is
not one of function's properties. postgres_fdw can push down many
intrinsic functions. oracle_fdw can push down less functions. file_fdw
cannot at all. So it doesn't seem rather an ability of FDW drivers.
Putting aside the maintenance trouble, it would work for intrinsic
functions.

Even with the feature, we still cannot push down user-defined
functions, or incompatible intrinsic functions, which the user wants
to push down knowing about the incompatibility. If we allow that, we
need to have a means to tell foreign servers about such functions. A
means other than ROUTINE MAPPING I can come up with is server options
and foreign table options.

> The SQL committee do love verbosity, don't they.

Sure..

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Soni M 2020-01-10 11:54:24 Encrypted connection SQL server fdw
Previous Message Peter 2020-01-10 02:23:42 Re: 12.1 not useable: clientlib fails after a dozen queries (GSSAPI ?)