Re: Changing SQL Inlining Behaviour (or...?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Adam Brightwell <adam(dot)brightwell(at)crunchydata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Peter Geoghegan <peter(dot)geoghegan(at)crunchydata(dot)com>, Joe Conway <joe(at)crunchydata(dot)com>
Subject: Re: Changing SQL Inlining Behaviour (or...?)
Date: 2019-02-02 20:26:28
Message-ID: 19148.1549139188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Further question about this ...

I'm thinking about exactly when indxpath.c should interrogate extensions'
planner support functions. Since it'll cost some cycles to look up and
call such functions, we don't want to do it if there's little or no chance
of getting an index match. Currently, what match_clause_to_indexcol()
does first for an operator clause is to see if match_index_to_operand()
succeeds for either operator input; if so it investigates more closely,
if not it ignores the clause. I'm thinking of maintaining that rule
for operators and adding the same rule for function clauses appearing
in WHERE. Therefore, an extension would only have the opportunity to
add a lossy index clause when some argument of its function or operator
is the same Var or expression that is indexed. Is that going to be
sufficient, or are there weird cases where an index condition could
be built but none of the top-level function or operator inputs
exactly match the index column?

The cases you've shown us, where you transform a function with
argument x into an indexable operator with the same argument x
as the potentially-indexed side, don't look like they'd have any
trouble with that restriction. But I'm worried that maybe I'm
missing something.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-02-02 20:48:41 Re: Refactoring IndexPath representation of index conditions
Previous Message Andrew Gierth 2019-02-02 20:14:18 Re: Ryu floating point output patch