Re: Avoid full GIN index scan when possible - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Avoid full GIN index scan when possible
Date
Msg-id CAPpHfdvT_t6ShG2pvptEWceDxEnyNRsm2MxmCWWvxBzQ-pbMuw@mail.gmail.com
Whole thread Raw
In response to Re: Avoid full GIN index scan when possible  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: Avoid full GIN index scan when possible
List pgsql-hackers
On Wed, Dec 25, 2019 at 8:25 AM Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
Patch requires further polishing including comments, minor refactoring
etc.  I'm going to continue work on this.

I also run the same performance comparison as Nikita [1] on my laptop.
The results are shown below.  PostgreSQL was built with -O2 and
asserts enabled.

                                       | Query time, ms |
            WHERE condition            | master | patch |
---------------------------------------+--------+-------+
 a @> '{}'                             |    117 |   116 |
 a @> '{}' and b @> '{}'               |    150 |   146 |
 a @> '{}' and b @> '{}' and c @> '{}' |    168 |   167 |
 a @> '{}' and a @@ '1'                |    126 |   0.6 |
 a @> '{}' and a @@ '-1'               |    128 |   3.2 |
 a @@ '!-1' and a @@ '1'               |    127 |   0.7 |
 a @@ '!1' and a @@ '-1'               |    122 |   4.4 |

Performance effect looks similar to patch #4 by Nikita.  I've tried to
add patch #4 to comparison, but I've catch assertion failure.

TRAP: FailedAssertion("key->includeNonMatching", File: "ginget.c", Line: 1340)

I'm going to continue polishing my version of patch.

Links
The Russian Postgres Company 

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: unsupportable composite type partition keys
Next
From: Takuma Hoshiai
Date:
Subject: Re: Implementing Incremental View Maintenance