Question about heap_inplace_update and VACUUM behavior - Mailing list pgsql-hackers

From Shiju Sivadazz
Subject Question about heap_inplace_update and VACUUM behavior
Date
Msg-id CAERa5bCTbeV3wk7udnbEdnr4NwihgmcSjwaF5vJO7HCs312YqA@mail.gmail.com
Whole thread Raw
Responses Re: Question about heap_inplace_update and VACUUM behavior
List pgsql-hackers

Hello PostgreSQL Hackers,

I am currently exploring the PostgreSQL source code to better understand the internal storage and update mechanisms. While reviewing the heap access methods, I noticed the function heap_inplace_update() in the source code with the following comment:

/* * heap_inplace_update - deprecated * * This exists only to keep modules working in back branches. Affected * modules should migrate to systable_inplace_update_begin(). */

From my understanding, PostgreSQL generally follows the MVCC model, where updates create a new tuple version rather than modifying the existing tuple in place.

This raised a few questions for me:

  1. Does PostgreSQL still support any form of in-place updates internally, or is this function strictly kept for backward compatibility?

  2. What types of system catalog operations (if any) rely on in-place updates through systable_inplace_update_begin()?

  3. Since in-place updates do not generate a new tuple version, how does VACUUM interact with such updates? Does it need to handle them differently compared to normal MVCC updates?

  4. Are there any performance or concurrency considerations that influenced the decision to deprecate heap_inplace_update in favor of the newer APIs?

I would greatly appreciate any clarification or references to relevant documentation or design discussions.

Thank you for your time and for the incredible work on PostgreSQL.

Best regards,
Shiju
Software Developer
Currently studying PostgreSQL internals

pgsql-hackers by date:

Previous
From: Madhav Madhusoodanan
Date:
Subject: Re: [WiP] B-tree page merge during vacuum to reduce index bloat
Next
From: "Masashi Kamura (Fujitsu)"
Date:
Subject: ECPG: inconsistent behavior with the document in “GET/SET DESCRIPTOR.”