88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.154 2000/05/29 16:06:37 momjian Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.155 2000/05/29 16:21:04 momjian Exp $
1212 *
1313
1414 *-------------------------------------------------------------------------
@@ -74,10 +74,10 @@ static TransactionId XmaxRecent;
7474/* non-export function prototypes */
7575static void vacuum_init (void );
7676static void vacuum_shutdown (void );
77- static void vac_vacuum (NameData * VacRelP ,bool analyze ,List * va_cols );
77+ static void vac_vacuum (NameData * VacRelP ,bool analyze ,List * anal_cols2 );
7878static VRelList getrels (NameData * VacRelP );
79- static void vacuum_rel (Oid relid ,bool analyze , List * va_cols );
80- static void analyze_rel (Oid relid ,List * va_cols );
79+ static void vacuum_rel (Oid relid ,bool analyze );
80+ static void analyze_rel (Oid relid ,List * anal_cols2 );
8181static void scan_heap (VRelStats * vacrelstats ,Relation onerel ,VPageList vacuum_pages ,VPageList fraged_pages );
8282static void repair_frag (VRelStats * vacrelstats ,Relation onerel ,VPageList vacuum_pages ,VPageList fraged_pages ,int nindices ,Relation * Irel );
8383static void vacuum_heap (VRelStats * vacrelstats ,Relation onerel ,VPageList vpl );
@@ -105,16 +105,16 @@ static char *show_rusage(struct rusage * ru0);
105105/* CommonSpecialPortal function at the bottom */
106106
107107void
108- vacuum (char * vacrel ,bool verbose ,bool analyze ,List * va_spec )
108+ vacuum (char * vacrel ,bool verbose ,bool analyze ,List * anal_cols )
109109{
110110NameData VacRel ;
111111Name VacRelName ;
112112PortalVariableMemory pmem ;
113113MemoryContext old ;
114114List * le ;
115- List * va_cols = NIL ;
115+ List * anal_cols2 = NIL ;
116116
117- if (va_spec != NIL && !analyze )
117+ if (anal_cols != NIL && !analyze )
118118elog (ERROR ,"Can't vacuum columns, only tables. You can 'vacuum analyze' columns." );
119119
120120/*
@@ -149,11 +149,11 @@ vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
149149/* must also copy the column list, if any, to safe storage */
150150pmem = CommonSpecialPortalGetMemory ();
151151old = MemoryContextSwitchTo ((MemoryContext )pmem );
152- foreach (le ,va_spec )
152+ foreach (le ,anal_cols )
153153{
154154char * col = (char * )lfirst (le );
155155
156- va_cols = lappend (va_cols ,pstrdup (col ));
156+ anal_cols2 = lappend (anal_cols2 ,pstrdup (col ));
157157}
158158MemoryContextSwitchTo (old );
159159
@@ -168,7 +168,7 @@ vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
168168vacuum_init ();
169169
170170/* vacuum the database */
171- vac_vacuum (VacRelName ,analyze ,va_cols );
171+ vac_vacuum (VacRelName ,analyze ,anal_cols2 );
172172
173173/* clean up */
174174vacuum_shutdown ();
@@ -234,7 +234,7 @@ vacuum_shutdown()
234234 *locks at one time.
235235 */
236236static void
237- vac_vacuum (NameData * VacRelP ,bool analyze ,List * va_cols )
237+ vac_vacuum (NameData * VacRelP ,bool analyze ,List * anal_cols2 )
238238{
239239VRelList vrl ,
240240cur ;
@@ -244,12 +244,12 @@ vac_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
244244
245245/* vacuum each heap relation */
246246for (cur = vrl ;cur != (VRelList )NULL ;cur = cur -> vrl_next )
247- vacuum_rel (cur -> vrl_relid ,analyze , va_cols );
247+ vacuum_rel (cur -> vrl_relid ,analyze );
248248
249249/* analyze separately so locking is minimized */
250250if (analyze )
251251for (cur = vrl ;cur != (VRelList )NULL ;cur = cur -> vrl_next )
252- analyze_rel (cur -> vrl_relid ,va_cols );
252+ analyze_rel (cur -> vrl_relid ,anal_cols2 );
253253}
254254
255255static VRelList
@@ -359,7 +359,7 @@ getrels(NameData *VacRelP)
359359 *us to lock the entire database during one pass of the vacuum cleaner.
360360 */
361361static void
362- vacuum_rel (Oid relid ,bool analyze , List * va_cols )
362+ vacuum_rel (Oid relid ,bool analyze )
363363{
364364HeapTuple tuple ;
365365Relation onerel ;
@@ -508,7 +508,7 @@ vacuum_rel(Oid relid, bool analyze, List *va_cols)
508508 *analyze_rel() -- analyze relation
509509 */
510510static void
511- analyze_rel (Oid relid ,List * va_cols )
511+ analyze_rel (Oid relid ,List * anal_cols2 )
512512{
513513HeapTuple tuple ,
514514typetuple ;
@@ -569,16 +569,16 @@ analyze_rel(Oid relid, List *va_cols)
569569attr_cnt = onerel -> rd_att -> natts ;
570570attr = onerel -> rd_att -> attrs ;
571571
572- if (va_cols != NIL )
572+ if (anal_cols2 != NIL )
573573{
574574int tcnt = 0 ;
575575List * le ;
576576
577- if (length (va_cols )> attr_cnt )
577+ if (length (anal_cols2 )> attr_cnt )
578578elog (ERROR ,"vacuum: too many attributes specified for relation %s" ,
579579RelationGetRelationName (onerel ));
580580attnums = (int * )palloc (attr_cnt * sizeof (int ));
581- foreach (le ,va_cols )
581+ foreach (le ,anal_cols2 )
582582{
583583char * col = (char * )lfirst (le );
584584