Re: BUG #15290: Stuck Parallel Index Scan query

Victor Yegorov <vyegorov@gmail.com>

From: Victor Yegorov <vyegorov@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2018-07-22T20:52:23Z
Lists: pgsql-bugs
вс, 22 июл. 2018 г. в 21:31, PG Bug reporting form <noreply@postgresql.org>:

> The following bug has been logged on the website:
>
> Bug reference:      15290
> Logged by:          Victor Yegorov
> Email address:      vyegorov@gmail.com
> PostgreSQL version: 10.4
> Operating system:   Debian GNU/Linux 8.7 (jessie)
>

Some more details.
Index that was chosen for Parallel Index Scan was a partial index. And it
is quite bloated:

"coubs_type_is_done_partial_simple" btree (type, is_done) WHERE type::text
= 'Coub::Simple'::text
6766MB

What we did — created another, ordinary index:

"index_coubs_on_is_done_and_in_process_and_type" btree (is_done,
in_process, type)
2141MB

So now planner prefers to use new index and issue is not re-appearing.
Query executes within 10-20ms.
Old bloated index is still around for analysis. `amcheck` showed no issues
with it, though.


-- 
Victor Yegorov

Commits

  1. Fix the buffer release order for parallel index scans.