Which Order Vacuum Full Analyze Cluster Reindex?

Started by borajettaover 21 years ago4 messagesgeneral
Jump to latest
#1borajetta
borajetta@hotmail.com

I am trying to firgure out what the best order is?

I was thinking

Vacuum Full table;
Cluster table;
Analyze table;

I belive the vacuum full should be done first as it will remove the rows where no data exits so that when it is clustered it will be a perfect table, then analyze to build the info for the table.

Also where should the reindex's come in and should they be done?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: borajetta (#1)
Re: Which Order Vacuum Full Analyze Cluster Reindex?

"borajetta" <borajetta@hotmail.com> writes:

I am trying to firgure out what the best order is?

Vacuum Full table;
Cluster table;
Analyze table;

If you are going to CLUSTER then you can forget the VACUUM part
entirely. Just do CLUSTER and then ANALYZE.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: Which Order Vacuum Full Analyze Cluster Reindex?

Tom Lane <tgl@sss.pgh.pa.us> writes:

If you are going to CLUSTER then you can forget the VACUUM part
entirely. Just do CLUSTER and then ANALYZE.

Out of curiosity, does cluster also effectively do a reindex?

--
greg

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: Which Order Vacuum Full Analyze Cluster Reindex?

Greg Stark <gsstark@mit.edu> writes:

Tom Lane <tgl@sss.pgh.pa.us> writes:

If you are going to CLUSTER then you can forget the VACUUM part
entirely. Just do CLUSTER and then ANALYZE.

Out of curiosity, does cluster also effectively do a reindex?

Yes, of course. It rewrites a whole new table and then rebuilds
the indexes.

regards, tom lane