Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans - Mailing list pgsql-performance

From Tom Lane
Subject Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans
Date
Msg-id 27387.1287442870@sss.pgh.pa.us
Whole thread Raw
In response to unexpected query failure: ERROR: GIN indexes do not support whole-index scans  (Jon Nelson <jnelson+pgsql@jamponi.net>)
Responses Re: unexpected query failure: ERROR: GIN indexes do not support whole-index scans
List pgsql-performance
Jon Nelson <jnelson+pgsql@jamponi.net> 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

pgsql-performance by date:

Previous
From: Jon Nelson
Date:
Subject: unexpected query failure: ERROR: GIN indexes do not support whole-index scans
Next
From: Scott Carey
Date:
Subject: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?