Thread: Which Order Vacuum Full Analyze Cluster Reindex?
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?
"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
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
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