Re: Avoid full GIN index scan when possible

Alexander Korotkov <a.korotkov@postgrespro.ru>

From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Julien Rouhaud <rjuju123@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Nikita Glukhov <n.gluhov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Thomas Munro <thomas.munro@gmail.com>, Marc Cousin <cousinmarc@gmail.com>
Date: 2020-01-14T22:56:47Z
Lists: pgsql-hackers
On Wed, Jan 15, 2020 at 1:47 AM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> I also had concerns about how excludeOnly keys work with lossy pages.
> I didn't find exact error.  But I've added code, which skips
> excludeOnly keys checks for lossy pages.  They aren't going to exclude
> any lossy page anyway.  So, we can save some resources by skipping
> this.

I also found the way we combine lossy pages and exact TIDs pretty
asymmetric.  Imagine one scan key A matches a lossy page, while
another key B have set of matching TIDs on the same page.  If key A
goes first, we will report a lossy page.  But if key B goes first, we
will report a set of TIDs with recheck set.  It would be nice to
improve.  But this is definitely subject of a separate patch.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



Commits

  1. Avoid full scan of GIN indexes when possible