pgsql: Allow skipping some items in a multi-key GIN search.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow skipping some items in a multi-key GIN search.
Date: 2014-01-29 15:54:20
Message-ID: E1W8XT2-0006T5-DM@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow skipping some items in a multi-key GIN search.

In a multi-key search, ie. something like "col @> 'foo' AND col @> 'bar'",
as soon as we find the next item that matches the first criteria, we don't
need to check the second criteria for TIDs smaller the first match. That
saves a lot of effort, especially if one of the terms is rare, while the
second occurs very frequently.

Based on ideas from Alexander Korotkov's fast scan patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e20c70cb0fa74d5bffa080e21a99b44bf0768667

Modified Files
--------------
src/backend/access/gin/ginget.c | 460 +++++++++++++++++++++------------------
1 file changed, 250 insertions(+), 210 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-29 16:27:35 pgsql: Further optimize multi-key GIN searches.
Previous Message Andrew Dunstan 2014-01-29 14:52:14 pgsql: Remedy two small omissions in the new json functions docs.