Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd950c19

Browse files
committed
more cleanup
1 parentac4de0c commitd950c19

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
staticvoidvacuum_init(void);
7676
staticvoidvacuum_shutdown(void);
77-
staticvoidvac_vacuum(NameData*VacRelP,boolanalyze,List*va_cols);
77+
staticvoidvac_vacuum(NameData*VacRelP,boolanalyze,List*anal_cols2);
7878
staticVRelListgetrels(NameData*VacRelP);
79-
staticvoidvacuum_rel(Oidrelid,boolanalyze,List*va_cols);
80-
staticvoidanalyze_rel(Oidrelid,List*va_cols);
79+
staticvoidvacuum_rel(Oidrelid,boolanalyze);
80+
staticvoidanalyze_rel(Oidrelid,List*anal_cols2);
8181
staticvoidscan_heap(VRelStats*vacrelstats,Relationonerel,VPageListvacuum_pages,VPageListfraged_pages);
8282
staticvoidrepair_frag(VRelStats*vacrelstats,Relationonerel,VPageListvacuum_pages,VPageListfraged_pages,intnindices,Relation*Irel);
8383
staticvoidvacuum_heap(VRelStats*vacrelstats,Relationonerel,VPageListvpl);
@@ -105,16 +105,16 @@ static char *show_rusage(struct rusage * ru0);
105105
/* CommonSpecialPortal function at the bottom */
106106

107107
void
108-
vacuum(char*vacrel,boolverbose,boolanalyze,List*va_spec)
108+
vacuum(char*vacrel,boolverbose,boolanalyze,List*anal_cols)
109109
{
110110
NameDataVacRel;
111111
NameVacRelName;
112112
PortalVariableMemorypmem;
113113
MemoryContextold;
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
staticvoid
237-
vac_vacuum(NameData*VacRelP,boolanalyze,List*va_cols)
237+
vac_vacuum(NameData*VacRelP,boolanalyze,List*anal_cols2)
238238
{
239239
VRelListvrl,
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
staticVRelList
@@ -359,7 +359,7 @@ getrels(NameData *VacRelP)
359359
*us to lock the entire database during one pass of the vacuum cleaner.
360360
*/
361361
staticvoid
362-
vacuum_rel(Oidrelid,boolanalyze,List*va_cols)
362+
vacuum_rel(Oidrelid,boolanalyze)
363363
{
364364
HeapTupletuple;
365365
Relationonerel;
@@ -508,7 +508,7 @@ vacuum_rel(Oid relid, bool analyze, List *va_cols)
508508
*analyze_rel() -- analyze relation
509509
*/
510510
staticvoid
511-
analyze_rel(Oidrelid,List*va_cols)
511+
analyze_rel(Oidrelid,List*anal_cols2)
512512
{
513513
HeapTupletuple,
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
inttcnt=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/2915:44:55 momjian Exp $
10+
* $Id: vacuum.h,v 1.29 2000/05/2916:21:05 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -132,7 +132,7 @@ typedef struct VRelStats
132132
externboolVacuumRunning;
133133

134134
externvoidvc_abort(void);
135-
externvoidvacuum(char*vacrel,boolverbose,boolanalyze,List*va_spec);
135+
externvoidvacuum(char*vacrel,boolverbose,boolanalyze,List*anal_cols);
136136

137137
#defineATTNVALS_SCALE1000000000/* XXX so it can act as a float4 */
138138

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp