Re: index only scan question - Mailing list pgsql-general

From Laurenz Albe
Subject Re: index only scan question
Date
Msg-id 3053c9cec512260c53e4f48cab370a295b6ff4af.camel@cybertec.at
Whole thread Raw
In response to Re: index only scan question  (Daniel Westermann <daniel.westermann@dbi-services.com>)
List pgsql-general
Daniel Westermann wrote:
> >I'd say the old index tuple was killed during the first scan:
> >https://www.cybertec-postgresql.com/en/killed-index-tuples/
> 
> ... from your blog: "Whenever an index scan fetches a heap tuple only to find that it is dead
> (that the entire “HOT chain” of tuples is dead, to be more precise), it marks the index tuple
> as “killed”. Then future index scans can simply ignore it.
> 
> I understand that, but in my case the chain is not dead so this does not explain the difference.
> Do I miss something?

I assume that the UPDATE was not HOT, because the first scan had to fetch two tuples.

After the UPDATE, the original tuple was dead (the HOT chain consists
only of a single tuple here, because it was no HOT update).
The first index scan detects that and marks the index tuple as killed.
The second index scan only visits the new tuple.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Daniel Westermann
Date:
Subject: Re: index only scan question
Next
From: Jean-Marc Lessard
Date:
Subject: pg_dump out of memory for large table with LOB