Re: [HACKERS] query planner does not canonicalize infix operators

2012-04-15 Thread Tom Lane
Dimitri Fontaine 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

Re: [HACKERS] query planner does not canonicalize infix operators

2012-04-15 Thread Dimitri Fontaine
Tom Lane writes: > More generally, I'm not prepared to buy into the idea that the planner > should be expected to recognize alternate spellings of "the same" > expression. There are too many variants of that idea that are > infeasible either because the planner doesn't have the necessary > knowle

Re: [HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Peter Eisentraut
On mån, 2012-03-12 at 13:04 -0700, Daniel Farina wrote: > On the more constructive side, if I were to till the fields to change > this aspect of the optimizer, is there any interest in rectifying the > operator-function confusion? I once proposed to do that [1], but there was not much enthusiasm e

Re: [HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Daniel Farina
On Mon, Mar 12, 2012 at 12:22 PM, Tom Lane wrote: > Daniel Farina writes: >> On Mon, Mar 12, 2012 at 7:52 AM, Tom Lane wrote: >>> Will Leinweber writes: I created an index on an hstore function, fetchval(hstore, text), however when I use the -> infix operator which resolves to the ver

Re: [HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Tom Lane
Daniel Farina writes: > On Mon, Mar 12, 2012 at 7:52 AM, Tom Lane wrote: >> Will Leinweber writes: >>> I created an index on an hstore function, fetchval(hstore, text), however >>> when I use the -> infix operator which resolves to the very same function, >>> this index is not used. It should be

Re: [HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Daniel Farina
On Mon, Mar 12, 2012 at 7:52 AM, Tom Lane wrote: > Will Leinweber writes: >> I created an index on an hstore function, fetchval(hstore, text), however >> when I use the -> infix operator which resolves to the very same function, >> this index is not used. It should be used. > > Don't hold your br

Re: [HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Tom Lane
Will Leinweber writes: > I created an index on an hstore function, fetchval(hstore, text), however > when I use the -> infix operator which resolves to the very same function, > this index is not used. It should be used. Don't hold your breath. Create an index on the expression you intend to use

[HACKERS] query planner does not canonicalize infix operators

2012-03-12 Thread Will Leinweber
I created an index on an hstore function, fetchval(hstore, text), however when I use the -> infix operator which resolves to the very same function, this index is not used. It should be used. I have included an example: Table with hstore index: de10keipt01939=> \d log_data