Re: Index-only scan returns incorrect results when using a composite GIST index with a gist_trgm_ops column.

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: sk@zsrv.org, david@nlpgo.com, pgsql-bugs@lists.postgresql.org, pgsql-hackers@postgresql.org
Date: 2018-01-18T07:57:38Z
Lists: pgsql-bugs, pgsql-hackers
Hello!
> 18 янв. 2018 г., в 10:48, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> написал(а):
> 
> Gist imposes the ninth strategy to perform index only scan but
> planner is not considering that
> ....
> Please find the attached patch.
I agree with you that current behavior is a bug and your patch seems correct.
I'm a bit worried about ninth strategy words: fetch is not necessary now, if opclass lacks compress methods - index only scan is possible. See https://github.com/postgres/postgres/commit/d3a4f89d8a3e500bd7c0b7a8a8a5ce1b47859128 for details.
Though there are tests in cube and seg for that, if your patch passes check-world, than this behavior is not affected.

Thank you for the patch!

Best regards, Andrey Borodin.

Commits

  1. Improve stability of recently-added regression test case.

  2. Fix IOS planning when only some index columns can return an attribute.

  3. Ability to advance replication slots

  4. Allow no-op GiST support functions to be omitted.