Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2A8A3B5DBC4 for ; Thu, 29 Sep 2011 01:08:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 94619-04 for ; Thu, 29 Sep 2011 04:08:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 08575B5DBC0 for ; Thu, 29 Sep 2011 01:08:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8T48EpP018822; Thu, 29 Sep 2011 00:08:14 -0400 (EDT) To: Greg Stark cc: Peter Eisentraut , Pierre Ducroquet , pgsql-bugs@postgresql.org Subject: Re: BUG #6232: hstore operator ? no longer uses indexes In-reply-to: References: <201109282050.p8SKoA4O084649@wwwmaster.postgresql.org> <13745.1317264175@sss.pgh.pa.us> <1317266569.18190.0.camel@vanquo.pezone.net> Comments: In-reply-to Greg Stark message dated "Thu, 29 Sep 2011 05:00:45 +0100" Date: Thu, 29 Sep 2011 00:08:14 -0400 Message-ID: <18821.1317269294@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/227 X-Sequence-Number: 31244 Greg Stark writes: > On Thu, Sep 29, 2011 at 4:22 AM, Peter Eisentraut 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