Re: [Proposal] Table partition + join pushdown

From: Greg Stark <stark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Taiki Kondo <tai-kondo(at)yk(dot)jp(dot)nec(dot)com>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Hiroshi Yanagisawa <hir-yanagisawa(at)ut(dot)jp(dot)nec(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: [Proposal] Table partition + join pushdown
Date: 2016-01-19 12:59:11
Message-ID: CAM-w4HPCaWqvdRuVevxAV=qtYx-uVGBKP1NWMP1o=43pTPXpgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 18, 2016 at 5:55 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> For
> example, suppose that x and y are numeric columns and P(x) is
> length(x::text) == 3. Then you could have 1 in one table and 1.0 in
> the table; they join, but P(x) is true for one and false for the
> other.

Fwiw, ages ago there was some talk about having a property on
functions "equality preserving" or something like that. If a function,
or more likely a <function,operator> tuple had this property set then
x op y => f(x) op f(y). This would be most useful for things like
substring or hash functions which would allow partial indexes or
partition exclusion to be more generally useful.

Of course then you really want <f,op1,op2> to indicate that "a op1 b
=> f(a) op2 f(b)" so you can handle things like <substring,lt,lte > so
that "a < b => substring(a,n) <= substring(b,n)" and you need some way
to represent the extra arguments to substring and the whole thing
became too complex and got dropped.

But perhaps even a simpler property that only worked for equality and
single-argument functions would be useful since it would let us mark
hash functions Or perhaps we only need to mark the few functions that
expose properties that don't affect equality since I think there are
actually very few of them.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-01-19 13:03:21 Re: custom function for converting human readable sizes to bytes
Previous Message Robert Haas 2016-01-19 12:51:55 Re: Combining Aggregates