Re: Trying to understand page structures in PG

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rakesh Kumar <rakeshkumar464a3(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to understand page structures in PG
Date: 2016-04-06 14:00:20
Message-ID: 57051674.4000002@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/06/2016 02:39 AM, Rakesh Kumar wrote:
> Hello
>
> I understand that when an update of say 100,000 rows are made, PG
> writes the updated rows as a new row. These new rows are not visible
> to any sessions except the one creating it. At commit time PG flips
> something internally to make these rows visible to all.
>
> My Q: what happens to those rows which use to contain the values
> before the update. Shouldn't something change in those rows to
> indicate that those rows are no longer valid. Who does it chain those
> rows to the new rows.

They are marked dead and at a threshold vacuum will come along
automatically and mark them reusable.

The vacuum and maintenance docs explain this pretty well.

Sincerely,

JD

>
> thanks.
>
>

--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2016-04-06 14:16:27 Re: what database schema version management system to use?
Previous Message Adrian Klaver 2016-04-06 13:50:16 Re: what database schema version management system to use?