Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d950c197
Commit
d950c197
authored
May 29, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more cleanup
parent
ac4de0cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+18
-18
src/include/commands/vacuum.h
src/include/commands/vacuum.h
+2
-2
No files found.
src/backend/commands/vacuum.c
View file @
d950c197
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.15
4 2000/05/29 16:06:37
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.15
5 2000/05/29 16:21:04
momjian Exp $
*
*-------------------------------------------------------------------------
...
...
@@ -74,10 +74,10 @@ static TransactionId XmaxRecent;
/* non-export function prototypes */
static
void
vacuum_init
(
void
);
static
void
vacuum_shutdown
(
void
);
static
void
vac_vacuum
(
NameData
*
VacRelP
,
bool
analyze
,
List
*
va_cols
);
static
void
vac_vacuum
(
NameData
*
VacRelP
,
bool
analyze
,
List
*
anal_cols2
);
static
VRelList
getrels
(
NameData
*
VacRelP
);
static
void
vacuum_rel
(
Oid
relid
,
bool
analyze
,
List
*
va_cols
);
static
void
analyze_rel
(
Oid
relid
,
List
*
va_cols
);
static
void
vacuum_rel
(
Oid
relid
,
bool
analyze
);
static
void
analyze_rel
(
Oid
relid
,
List
*
anal_cols2
);
static
void
scan_heap
(
VRelStats
*
vacrelstats
,
Relation
onerel
,
VPageList
vacuum_pages
,
VPageList
fraged_pages
);
static
void
repair_frag
(
VRelStats
*
vacrelstats
,
Relation
onerel
,
VPageList
vacuum_pages
,
VPageList
fraged_pages
,
int
nindices
,
Relation
*
Irel
);
static
void
vacuum_heap
(
VRelStats
*
vacrelstats
,
Relation
onerel
,
VPageList
vpl
);
...
...
@@ -105,16 +105,16 @@ static char *show_rusage(struct rusage * ru0);
/* CommonSpecialPortal function at the bottom */
void
vacuum
(
char
*
vacrel
,
bool
verbose
,
bool
analyze
,
List
*
va_spec
)
vacuum
(
char
*
vacrel
,
bool
verbose
,
bool
analyze
,
List
*
anal_cols
)
{
NameData
VacRel
;
Name
VacRelName
;
PortalVariableMemory
pmem
;
MemoryContext
old
;
List
*
le
;
List
*
va_cols
=
NIL
;
List
*
anal_cols2
=
NIL
;
if
(
va_spec
!=
NIL
&&
!
analyze
)
if
(
anal_cols
!=
NIL
&&
!
analyze
)
elog
(
ERROR
,
"Can't vacuum columns, only tables. You can 'vacuum analyze' columns."
);
/*
...
...
@@ -149,11 +149,11 @@ vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
/* must also copy the column list, if any, to safe storage */
pmem
=
CommonSpecialPortalGetMemory
();
old
=
MemoryContextSwitchTo
((
MemoryContext
)
pmem
);
foreach
(
le
,
va_spec
)
foreach
(
le
,
anal_cols
)
{
char
*
col
=
(
char
*
)
lfirst
(
le
);
va_cols
=
lappend
(
va_cols
,
pstrdup
(
col
));
anal_cols2
=
lappend
(
anal_cols2
,
pstrdup
(
col
));
}
MemoryContextSwitchTo
(
old
);
...
...
@@ -168,7 +168,7 @@ vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
vacuum_init
();
/* vacuum the database */
vac_vacuum
(
VacRelName
,
analyze
,
va_cols
);
vac_vacuum
(
VacRelName
,
analyze
,
anal_cols2
);
/* clean up */
vacuum_shutdown
();
...
...
@@ -234,7 +234,7 @@ vacuum_shutdown()
* locks at one time.
*/
static
void
vac_vacuum
(
NameData
*
VacRelP
,
bool
analyze
,
List
*
va_cols
)
vac_vacuum
(
NameData
*
VacRelP
,
bool
analyze
,
List
*
anal_cols2
)
{
VRelList
vrl
,
cur
;
...
...
@@ -244,12 +244,12 @@ vac_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
/* vacuum each heap relation */
for
(
cur
=
vrl
;
cur
!=
(
VRelList
)
NULL
;
cur
=
cur
->
vrl_next
)
vacuum_rel
(
cur
->
vrl_relid
,
analyze
,
va_cols
);
vacuum_rel
(
cur
->
vrl_relid
,
analyze
);
/* analyze separately so locking is minimized */
if
(
analyze
)
for
(
cur
=
vrl
;
cur
!=
(
VRelList
)
NULL
;
cur
=
cur
->
vrl_next
)
analyze_rel
(
cur
->
vrl_relid
,
va_cols
);
analyze_rel
(
cur
->
vrl_relid
,
anal_cols2
);
}
static
VRelList
...
...
@@ -359,7 +359,7 @@ getrels(NameData *VacRelP)
* us to lock the entire database during one pass of the vacuum cleaner.
*/
static
void
vacuum_rel
(
Oid
relid
,
bool
analyze
,
List
*
va_cols
)
vacuum_rel
(
Oid
relid
,
bool
analyze
)
{
HeapTuple
tuple
;
Relation
onerel
;
...
...
@@ -508,7 +508,7 @@ vacuum_rel(Oid relid, bool analyze, List *va_cols)
* analyze_rel() -- analyze relation
*/
static
void
analyze_rel
(
Oid
relid
,
List
*
va_cols
)
analyze_rel
(
Oid
relid
,
List
*
anal_cols2
)
{
HeapTuple
tuple
,
typetuple
;
...
...
@@ -569,16 +569,16 @@ analyze_rel(Oid relid, List *va_cols)
attr_cnt
=
onerel
->
rd_att
->
natts
;
attr
=
onerel
->
rd_att
->
attrs
;
if
(
va_cols
!=
NIL
)
if
(
anal_cols2
!=
NIL
)
{
int
tcnt
=
0
;
List
*
le
;
if
(
length
(
va_cols
)
>
attr_cnt
)
if
(
length
(
anal_cols2
)
>
attr_cnt
)
elog
(
ERROR
,
"vacuum: too many attributes specified for relation %s"
,
RelationGetRelationName
(
onerel
));
attnums
=
(
int
*
)
palloc
(
attr_cnt
*
sizeof
(
int
));
foreach
(
le
,
va_cols
)
foreach
(
le
,
anal_cols2
)
{
char
*
col
=
(
char
*
)
lfirst
(
le
);
...
...
src/include/commands/vacuum.h
View file @
d950c197
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: vacuum.h,v 1.2
8 2000/05/29 15:44:5
5 momjian Exp $
* $Id: vacuum.h,v 1.2
9 2000/05/29 16:21:0
5 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -132,7 +132,7 @@ typedef struct VRelStats
extern
bool
VacuumRunning
;
extern
void
vc_abort
(
void
);
extern
void
vacuum
(
char
*
vacrel
,
bool
verbose
,
bool
analyze
,
List
*
va_spec
);
extern
void
vacuum
(
char
*
vacrel
,
bool
verbose
,
bool
analyze
,
List
*
anal_cols
);
#define ATTNVALS_SCALE 1000000000
/* XXX so it can act as a float4 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment