pgsql: Fix an additional set of problems in GIN's handling of lossy page - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix an additional set of problems in GIN's handling of lossy page
Date
Msg-id 20100801191639.B93F07541D5@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix an additional set of problems in GIN's handling of lossy page pointers.
Although the key-combining code claimed to work correctly if its input
contained both lossy and exact pointers for a single page in a single TID
stream, in fact this did not work, and could not work without pretty
fundamental redesign.  Modify keyGetItem so that it will not return such a
stream, by handling lossy-pointer cases a bit more explicitly than we did
before.

Per followup investigation of a gripe from Artur Dabrowski.
An example of a query that failed given his data set is
select count(*) from search_tab where
(to_tsvector('german', keywords ) @@ to_tsquery('german', 'ee:* | dd:*')) and
(to_tsvector('german', keywords ) @@ to_tsquery('german', 'aa:*'));

Back-patch to 8.4 where the lossy pointer code was introduced.

Modified Files:
--------------
    pgsql/src/backend/access/gin:
        ginget.c (r1.31 -> r1.32)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/gin/ginget.c?r1=1.31&r2=1.32)
    pgsql/src/include/access:
        gin.h (r1.40 -> r1.41)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/gin.h?r1=1.40&r2=1.41)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Rewrite the rbtree routines so that an RBNode is the first field
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix an additional set of problems in GIN's handling of lossy page