Re: Postgresql | Vacuum information - Mailing list pgsql-admin

From MichaelDBA
Subject Re: Postgresql | Vacuum information
Date
Msg-id 5A97194B.30709@sqlexec.com
Whole thread Raw
In response to Re: Postgresql | Vacuum information  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Postgresql | Vacuum information  (MichaelDBA <MichaelDBA@sqlexec.com>)
List pgsql-admin
Actually, David, that reference to the docs about "new rows" in https://www.postgresql.org/docs/10/static/routine-vacuuming.html#VACUUM-BASICS, recovering disk space, relates to UPDATEs and DELETEs, not INSERTs.  The main gain for reusing dead space is where UPDATES are concerned where it will try to insert on the same page if possible.

Regards,
Michael Vitale
Wednesday, February 28, 2018 1:37 PM
On Wed, Feb 28, 2018 at 11:31 AM, Sohel Tamboli <sohel.tamboli0016@gmail.com> wrote:
Hi, 

I need some information on vacuum in postgresql. I know that "vacuum full" recreate full table and releases space to OS. Only "vacuum" clears the dead tuples and free the space but does not returns free space to OS, indeed it keeps free space as a part of table. 
My question is, after running only "vacuum", how does new data or insert is written to the table? I need to know that Does new data gets inserted in free space available in between of live tuples or gets inserted at the end of table everytime. 


There would be no point to non-full vacuuming if "new data [was] inserted ... at the end of the table everytime"...

​ This logic is also documented:​

​"
The space it occupies must then be reclaimed for reuse by new rows, to avoid unbounded growth of disk space requirements. This is done by running VACUUM.
​"​

​ David J.

Wednesday, February 28, 2018 1:31 PM
Hi, 

I need some information on vacuum in postgresql. I know that "vacuum full" recreate full table and releases space to OS. Only "vacuum" clears the dead tuples and free the space but does not returns free space to OS, indeed it keeps free space as a part of table. 
My question is, after running only "vacuum", how does new data or insert is written to the table? I need to know that Does new data gets inserted in free space available in between of live tuples or gets inserted at the end of table everytime. 

Appreciate your quick response!! 

Thanks, 
Sohel

pgsql-admin by date:

Previous
From: Nagy László Zsolt
Date:
Subject: Re: Reliable WAL file shipping over unreliable network
Next
From: chris
Date:
Subject: audit table with permissions