Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4FECDB5DC0F for ; Sat, 2 Jul 2011 19:39:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 91263-01 for ; Sat, 2 Jul 2011 22:38:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 93990B5DC0C for ; Sat, 2 Jul 2011 19:38:55 -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 p62McrbX021087; Sat, 2 Jul 2011 18:38:53 -0400 (EDT) To: Jeff Davis cc: oleg@sai.msu.su, Denis de Bernardy , Teodor Sigaev , pgsql-bugs@postgresql.org Subject: Re: Re: PG regression with row comparison when btree_gist is enabled (BUG) In-reply-to: <1308504190.2597.71.camel@jdavis> References: <4DF81BA0.3000601@archidevsys.co.nz> <743036.48052.qm@web112401.mail.gq1.yahoo.com> <366790.65150.qm@web112414.mail.gq1.yahoo.com> <1308428403.2597.66.camel@jdavis> <1308504190.2597.71.camel@jdavis> Comments: In-reply-to Jeff Davis message dated "Sun, 19 Jun 2011 10:23:10 -0700" Date: Sat, 02 Jul 2011 18:38:53 -0400 Message-ID: <21086.1309646333@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/10 X-Sequence-Number: 30622 Jeff Davis writes: > On Sat, 2011-06-18 at 13:20 -0700, Jeff Davis wrote: >> Interesting problem... the bug is in get_op_btree_interpretation() which >> has code like this: >> ... >> However, that's a bogus test, because btree_gist puts <> into an >> opfamily. Thus, catlist->n_members == 1 even though we really do need to >> look for the negator. Really, we need to unconditionally search for the >> operator as well as unconditionally searching for the negator. > Patch attached. I looked at this a bit. The proposed patch is inadequate, aside from any excess lookups it introduces, because there is similar logic in predtest.c. To make the world safe for btree_gist to do this, we'd have to add extra lookup activity there as well. Quite honestly, I think that the bug is that btree_gist took it upon itself to invent <> as an indexable operator. The odds that that will ever be of practical use seem negligible, and not at all adequate to warrant adding extra cycles into mainstream code paths. It's not too late to rip that out of 9.1, and that's what I think we should do. regards, tom lane