Re: "Healing" a table after massive updates - Mailing list pgsql-general

From Gauthier, Dave
Subject Re: "Healing" a table after massive updates
Date
Msg-id 0836165E8EE50F40A3DD8F0D8713726701056C38@azsmsx421.amr.corp.intel.com
Whole thread Raw
In response to "Healing" a table after massive updates  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Responses Re: "Healing" a table after massive updates  (Bill Moran <wmoran@collaborativefusion.com>)
List pgsql-general

I might be able to answer my own question...

vacuum FULL (analyze is optional)

 

Correct?

 


From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Gauthier, Dave
Sent: Thursday, September 11, 2008 10:01 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] "Healing" a table after massive updates

 

Hi:

 

I have a job that loads a large table, but then has to “update” about half the records for various reasons.  My perception of what happens on update for a particular recors is...

- a new record will be inserted with the updated value(s).

- The old record is marked as being obselete.

- Not sure what happens to index elements that pointed to the original (now obselete) record. Is it updated to point directly at the newly inserted record?  Or does it use the obselete record as a “link” to the newly inserted record?

 

My concern is that the resulting table is not in optimal shape for queries.  I would like to get rid of the obseleted records (vacuum I believe) but also “heal” the table in terms of filling in the holes left where those deleted records used to be (will gather more records per disk block read if record density on disk is greater).  Is there a way to do this?

 

Thanks

pgsql-general by date:

Previous
From: "Gauthier, Dave"
Date:
Subject: "Healing" a table after massive updates
Next
From: Brad Nicholson
Date:
Subject: Re: "Healing" a table after massive updates