Re: Super PathKeys (Allowing sort order through precision loss functions)

From: Andres Freund <andres(at)anarazel(dot)de>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Super PathKeys (Allowing sort order through precision loss functions)
Date: 2018-10-31 23:24:40
Message-ID: 20181031232440.x2oe7xnqritpoqxw@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-11-01 12:19:32 +1300, David Rowley wrote:
> On 1 November 2018 at 12:11, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
> > I still have trouble imagining what exactly would the function do to
> > determine if the optimization can be applied to substr() and similar
> > collation-dependent cases.
>
> I guess the function would have to check for a Const offset of 0, and
> a collection, perhaps of "C" for the 1st arg. In any case, I wouldn't
> want this idea to be hung up on the fact we can't determine how to
> make substr() work correctly with it.
>
> I'm most interested in date_trunc() and friends. A first cut
> implementation would not have to implement functions for everything
> that's possible to implement.

FWIW, I kind of wonder if we built proper infrastructure to allow to
make such inferrences from function calls, whether it could also be made
to support the transformation of LIKEs into indexable <= >= clauses.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-10-31 23:58:05 Re: Speeding up INSERTs and UPDATEs to partitioned tables
Previous Message Nasby, Jim 2018-10-31 23:21:33 Re: COPY FROM WHEN condition