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 CAPpHfdugwqUOfE5sw94ZKuUtU+Y97s57stA1q1AsioQido5c5A@mail.gmail.com
Whole thread Raw
In response to Re: Avoid full GIN index scan when possible  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On Sat, Jun 29, 2019 at 1:25 PM Tomas Vondra
<tomas.vondra@2ndquadrant.com> wrote:
> A related issue is that during costing is too late to modify cardinality
> estimates, so the 'Bitmap Index Scan' will be expected to return fewer
> rows than it actually returns (after ignoring the full-scan quals).
> Ignoring redundant quals (the way btree does it at execution) does not
> have such consequence, of course.

Adjust cardinality estimates should be possible in gincostestimate(),
because we call extractquery() method there.  However, it seems to be
quite independent issue.  Number of rows returned by 'Bitmap Index
Scan' doesn't vary much whether we execute GIN_SEARCH_MODE_ALL or not.
The only difference is for multicolumn index, GIN_SEARCH_MODE_ALL
allows to exclude NULL on one column, when normal scan is performed on
another column.  And we can take it into account in gincostestimate().

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Regression tests vs existing users in an installation
Next
From: Alexander Korotkov
Date:
Subject: Re: Avoid full GIN index scan when possible