Re: query planner does not canonicalize infix operators - Mailing list pgsql-hackers

From Tom Lane
Subject Re: query planner does not canonicalize infix operators
Date
Msg-id 8619.1334503282@sss.pgh.pa.us
Whole thread Raw
In response to Re: query planner does not canonicalize infix operators  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> Looks like we're missing out some operator properties, like the neutral
> element and if the operator is transitive, commutative or associative. I
> think I remember us talking about how knowing about operators being
> associative would also help optimize a class of join problems.

We do understand, and use, transitivity for btree equality operators
(cf mergejoin planning, EquivalenceClasses, etc).  I have limited
enthusiasm for introducing a more general concept, because it seems like
doing anything with it would add a great deal more planning effort for
(typically) little reward.  I can imagine cases where, say, deducing
"a < c" from "a < b and b < c" would be helpful ... but they don't come
up in common queries.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: documentation bug - missing info about unpackaged control files for extension
Next
From: Tom Lane
Date:
Subject: Re: Clobbered parameter names via DECLARE in PL/PgSQL