Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 45C3CB5DBE0 for ; Wed, 28 Sep 2011 23:43:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 81552-06 for ; Thu, 29 Sep 2011 02:43:00 +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 E9108B5DBF2 for ; Wed, 28 Sep 2011 23:42:59 -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 p8T2gtc5013746; Wed, 28 Sep 2011 22:42:55 -0400 (EDT) To: "Pierre Ducroquet" cc: pgsql-bugs@postgresql.org, Peter Eisentraut Subject: Re: BUG #6232: hstore operator ? no longer uses indexes In-reply-to: <201109282050.p8SKoA4O084649@wwwmaster.postgresql.org> References: <201109282050.p8SKoA4O084649@wwwmaster.postgresql.org> Comments: In-reply-to "Pierre Ducroquet" message dated "Wed, 28 Sep 2011 20:50:10 +0000" Date: Wed, 28 Sep 2011 22:42:55 -0400 Message-ID: <13745.1317264175@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/222 X-Sequence-Number: 31239 "Pierre Ducroquet" writes: > [ the "hstore ? text" operator no longer matches an hstore GIST index ] Hmm ... this doesn't seem to be specific to either hstore or GIST; it's a collation problem. The index is marked as having no collation, which is reasonable since hstore is a collation-less type. However, the ? OpExpr gets marked as having "default" collation because it has one collatable input, namely the text constant. And then, match_clause_to_indexcol decides the clause doesn't match the index. Not sure what to do about this. Is it okay to suppose that collation can be ignored when matching to a collation-less index? If not, what's the correct rule? I don't like the idea of concluding that hstore has to be forcibly assigned a collation just because it has some operators that accept text ... regards, tom lane