Re: Why vacuum_index_cleanup is needed for TOAST relations?

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Why vacuum_index_cleanup is needed for TOAST relations?
Date: 2019-07-05 14:15:45
Message-ID: 20190705141545.iyg47wbwgmo6ewqv@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 05, 2019 at 03:28:26PM +0300, Nikolay Shaplov wrote:
>I am importing recent changes into my reloption patch and came to a question,
>I did not find an answer...
>
>vacuum_index_cleanup option exists for both heap and toast relations.
>
>As I understand from documentation index cleanup is about is about reporting
>access method that some tuples in table that were indexed are dead, and should
>be cleaned.
>
>And as far as I get, we do not index any TOAST tuples directly. They are
>obtained by getting relation tuple, and then deTOAST it.
>
>So I do not understand why do we need vacuum_index_cleanup for TOAST tables.
>May be we should remove it from there??
>
>Or if I am wrong, can you explain where it is needed?
>

I'm not sure I understand your question / suggestion correctly, but
each TOAST table certainly has an index on (chunk_id, chunk_seq) - in
fact it's a unique index backing a primary key.

It's not clear to me what you mean by "index any TOAST tuples directly"
or "getting relation tuple", perhaps you could explain.

IMHO it's correct to have vacuum_index_cleanup even for TOAST tables.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-07-05 14:21:26 Re: [PATCH] Implement uuid_version()
Previous Message Jeff Janes 2019-07-05 14:13:25 mcv compiler warning