File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1111 *
1212 *
1313 * IDENTIFICATION
14- * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.90 2002/09/04 20:31:14 momjian Exp $
14+ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.91 2002/11/02 21: 20:40 tgl Exp $
1515 *
1616 *-------------------------------------------------------------------------
1717 */
@@ -475,6 +475,20 @@ swap_relfilenodes(Oid r1, Oid r2)
475475
476476 /* we should not swap reltoastidxid */
477477
478+ /* swap size statistics too, since new rel has freshly-updated stats */
479+ {
480+ int4 swap_pages ;
481+ float4 swap_tuples ;
482+
483+ swap_pages = relform1 -> relpages ;
484+ relform1 -> relpages = relform2 -> relpages ;
485+ relform2 -> relpages = swap_pages ;
486+
487+ swap_tuples = relform1 -> reltuples ;
488+ relform1 -> reltuples = relform2 -> reltuples ;
489+ relform2 -> reltuples = swap_tuples ;
490+ }
491+
478492 /* Update the tuples in pg_class */
479493 simple_heap_update (relRelation , & reltup1 -> t_self , reltup1 );
480494 simple_heap_update (relRelation , & reltup2 -> t_self , reltup2 );
You can’t perform that action at this time.
0 commit comments