Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 61D80133655C for ; Mon, 18 Oct 2010 20:01:19 -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 05292-01 for ; Mon, 18 Oct 2010 23:01:13 +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 9696E133616B for ; Mon, 18 Oct 2010 20:01:11 -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 o9IN1AdU027388; Mon, 18 Oct 2010 19:01:11 -0400 (EDT) To: Jon Nelson cc: pgsql-performance@postgresql.org Subject: Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans In-reply-to: References: Comments: In-reply-to Jon Nelson message dated "Mon, 18 Oct 2010 15:59:26 -0500" Date: Mon, 18 Oct 2010 19:01:10 -0400 Message-ID: <27387.1287442870@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/294 X-Sequence-Number: 40712 Jon Nelson writes: > CREATE INDEX foo_idx ON t USING GIN (alternatecodes) WHERE > alternatecodes IS NOT NULL; > SELECT * FROM t WHERE alternatecodes IS NOT NULL; > ERROR: GIN indexes do not support whole-index scans Yep, this is a known issue. It's going to take major surgery on GIN to fix it, so don't hold your breath. In the particular case, what good do you think the WHERE clause is doing anyway? GIN won't index nulls at all ... which indeed is an aspect of the underlying issue --- see recent discussions, eg here: http://archives.postgresql.org/pgsql-hackers/2010-10/msg00521.php regards, tom lane