Skip to content

Commit d950c19

Browse files
committed
more cleanup
1 parent ac4de0c commit d950c19

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/backend/commands/vacuum.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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 */
7575
static void vacuum_init(void);
7676
static 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);
7878
static 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);
8181
static void scan_heap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages, VPageList fraged_pages);
8282
static void repair_frag(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages, VPageList fraged_pages, int nindices, Relation *Irel);
8383
static 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

107107
void
108-
vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
108+
vacuum(char *vacrel, bool verbose, bool analyze, List *anal_cols)
109109
{
110110
NameData VacRel;
111111
Name VacRelName;
112112
PortalVariableMemory pmem;
113113
MemoryContext old;
114114
List *le;
115-
List *va_cols = NIL;
115+
List *anal_cols2 = NIL;
116116

117-
if (va_spec != NIL && !analyze)
117+
if (anal_cols != NIL && !analyze)
118118
elog(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 */
150150
pmem = CommonSpecialPortalGetMemory();
151151
old = MemoryContextSwitchTo((MemoryContext) pmem);
152-
foreach(le, va_spec)
152+
foreach(le, anal_cols)
153153
{
154154
char *col = (char *) lfirst(le);
155155

156-
va_cols = lappend(va_cols, pstrdup(col));
156+
anal_cols2 = lappend(anal_cols2, pstrdup(col));
157157
}
158158
MemoryContextSwitchTo(old);
159159

@@ -168,7 +168,7 @@ vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
168168
vacuum_init();
169169

170170
/* vacuum the database */
171-
vac_vacuum(VacRelName, analyze, va_cols);
171+
vac_vacuum(VacRelName, analyze, anal_cols2);
172172

173173
/* clean up */
174174
vacuum_shutdown();
@@ -234,7 +234,7 @@ vacuum_shutdown()
234234
* locks at one time.
235235
*/
236236
static void
237-
vac_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
237+
vac_vacuum(NameData *VacRelP, bool analyze, List *anal_cols2)
238238
{
239239
VRelList vrl,
240240
cur;
@@ -244,12 +244,12 @@ vac_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
244244

245245
/* vacuum each heap relation */
246246
for (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 */
250250
if (analyze)
251251
for (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

255255
static VRelList
@@ -359,7 +359,7 @@ getrels(NameData *VacRelP)
359359
* us to lock the entire database during one pass of the vacuum cleaner.
360360
*/
361361
static void
362-
vacuum_rel(Oid relid, bool analyze, List *va_cols)
362+
vacuum_rel(Oid relid, bool analyze)
363363
{
364364
HeapTuple tuple;
365365
Relation onerel;
@@ -508,7 +508,7 @@ vacuum_rel(Oid relid, bool analyze, List *va_cols)
508508
* analyze_rel() -- analyze relation
509509
*/
510510
static void
511-
analyze_rel(Oid relid, List *va_cols)
511+
analyze_rel(Oid relid, List *anal_cols2)
512512
{
513513
HeapTuple tuple,
514514
typetuple;
@@ -569,16 +569,16 @@ analyze_rel(Oid relid, List *va_cols)
569569
attr_cnt = onerel->rd_att->natts;
570570
attr = onerel->rd_att->attrs;
571571

572-
if (va_cols != NIL)
572+
if (anal_cols2 != NIL)
573573
{
574574
int tcnt = 0;
575575
List *le;
576576

577-
if (length(va_cols) > attr_cnt)
577+
if (length(anal_cols2) > attr_cnt)
578578
elog(ERROR, "vacuum: too many attributes specified for relation %s",
579579
RelationGetRelationName(onerel));
580580
attnums = (int *) palloc(attr_cnt * sizeof(int));
581-
foreach(le, va_cols)
581+
foreach(le, anal_cols2)
582582
{
583583
char *col = (char *) lfirst(le);
584584

src/include/commands/vacuum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: vacuum.h,v 1.28 2000/05/29 15:44:55 momjian Exp $
10+
* $Id: vacuum.h,v 1.29 2000/05/29 16:21:05 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -132,7 +132,7 @@ typedef struct VRelStats
132132
extern bool VacuumRunning;
133133

134134
extern void vc_abort(void);
135-
extern void vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec);
135+
extern void vacuum(char *vacrel, bool verbose, bool analyze, List *anal_cols);
136136

137137
#define ATTNVALS_SCALE 1000000000 /* XXX so it can act as a float4 */
138138

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy