Re: BUG #6232: hstore operator ? no longer uses indexes - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6232: hstore operator ? no longer uses indexes
Date
Msg-id 18821.1317269294@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6232: hstore operator ? no longer uses indexes  (Greg Stark <stark@mit.edu>)
List pgsql-bugs
Greg Stark <stark@mit.edu> writes:
> On Thu, Sep 29, 2011 at 4:22 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
>>> Not sure what to do about this.  Is it okay to suppose that collation
>>> can be ignored when matching to a collation-less index?

>> That sounds correct on first reading.

> Doesn't this depend on the semantics of the ? operator?

Well, yeah.  But if the operator requires a particular collation, what's
it doing in an operator class for a collation-less indexed datatype?

I think the operator could actually depend on its input collation with
respect to some part of the processing it does on its collatable
right-hand input.  But if the left-hand column (the indexed column) is
of a non-collatable type, it's hard to see how the operator could depend
on the index having a collation.

Also, I've now tested a patch along these lines and it passes core and
contrib regression tests, so there's not anything too obviously broken
about the idea.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Greg Stark
Date:
Subject: Re: BUG #6232: hstore operator ? no longer uses indexes
Next
From: Craig Ringer
Date:
Subject: Re: BUG #5800: "corrupted" error messages (encoding problem ?)