On Sat, Jun 1, 2019 at 12:01 AM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> The question is, does INDEX SCAN clean up the garbage version of leaf page?
> Or it's a bug?
Yes, sometimes that happens -- the kill_prior_tuple optimization can
kick in, even with a simple SELECT.
It would be clearer what was going on if you forced a bitmap index
scan (e.g. "set enable_indexscan=off;"). That way, the EXPLAIN
(ANALYZE, BUFFERS) instrumentation will show heap blocks and index
blocks separately.
--
Peter Geoghegan