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
cb4292ea
Commit
cb4292ea
authored
Oct 07, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vacuum cleanups
parent
9549a8cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
29 deletions
+9
-29
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+9
-29
No files found.
src/backend/commands/vacuum.c
View file @
cb4292ea
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.8
3 1998/10/07 17:12
:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.8
4 1998/10/07 22:31
:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -306,26 +306,11 @@ vc_getrels(NameData *VacRelP)
d
=
heap_getattr
(
tuple
,
Anum_pg_class_relname
,
tupdesc
,
&
n
);
rname
=
(
char
*
)
d
;
/*
* don't vacuum large objects for now - something breaks when we
* do
*/
if
((
strlen
(
rname
)
>=
5
)
&&
rname
[
0
]
==
'x'
&&
rname
[
1
]
==
'i'
&&
rname
[
2
]
==
'n'
&&
(
rname
[
3
]
==
'v'
||
rname
[
3
]
==
'x'
)
&&
rname
[
4
]
>=
'0'
&&
rname
[
4
]
<=
'9'
)
{
elog
(
NOTICE
,
"Rel %s: can't vacuum LargeObjects now"
,
rname
);
continue
;
}
d
=
heap_getattr
(
tuple
,
Anum_pg_class_relkind
,
tupdesc
,
&
n
);
rkind
=
DatumGetChar
(
d
);
/* skip system relations */
if
(
rkind
!=
'r'
)
if
(
rkind
!=
RELKIND_RELATION
)
{
elog
(
NOTICE
,
"Vacuum: can not process index and certain system tables"
);
continue
;
...
...
@@ -372,8 +357,6 @@ vc_getrels(NameData *VacRelP)
static
void
vc_vacone
(
Oid
relid
,
bool
analyze
,
List
*
va_cols
)
{
Relation
rel
;
TupleDesc
tupdesc
;
HeapTuple
tuple
,
typetuple
;
Relation
onerel
;
...
...
@@ -389,9 +372,6 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
StartTransactionCommand
();
rel
=
heap_openr
(
RelationRelationName
);
tupdesc
=
RelationGetDescr
(
rel
);
/*
* Race condition -- if the pg_class tuple has gone away since the
* last time we saw it, we don't need to vacuum it.
...
...
@@ -401,7 +381,6 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tuple
))
{
heap_close
(
rel
);
CommitTransactionCommand
();
return
;
}
...
...
@@ -573,7 +552,6 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
/* all done with this class */
heap_close
(
onerel
);
heap_close
(
rel
);
/* update statistics in pg_class */
vc_updstats
(
vacrelstats
->
relid
,
vacrelstats
->
num_pages
,
...
...
@@ -1744,6 +1722,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
sd
;
HeapScanDesc
scan
;
HeapTuple
rtup
,
ctup
,
atup
,
stup
;
Form_pg_class
pgcform
;
...
...
@@ -1754,18 +1733,19 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
/*
* update number of tuples and number of pages in pg_class
*/
rtup
=
SearchSysCacheTuple
(
RELOID
,
ctup
=
SearchSysCacheTupleCopy
(
RELOID
,
ObjectIdGetDatum
(
relid
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
r
tup
))
if
(
!
HeapTupleIsValid
(
c
tup
))
elog
(
ERROR
,
"pg_class entry for relid %d vanished during vacuuming"
,
relid
);
rd
=
heap_openr
(
RelationRelationName
);
/* get the buffer cache tuple */
rtup
=
heap_fetch
(
rd
,
SnapshotNow
,
&
rtup
->
t_ctid
,
&
buffer
);
rtup
=
heap_fetch
(
rd
,
SnapshotNow
,
&
ctup
->
t_ctid
,
&
buffer
);
pfree
(
ctup
);
/* overwrite the existing statistics in the tuple */
vc_setpagelock
(
rd
,
ItemPointerGetBlockNumber
(
&
rtup
->
t_ctid
));
pgcform
=
(
Form_pg_class
)
GETSTRUCT
(
rtup
);
...
...
@@ -2175,7 +2155,7 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel)
k
++
;
}
else
elog
(
NOTICE
,
"CAN'
t
OPEN INDEX %u - SKIP IT"
,
ioid
[
i
]);
elog
(
NOTICE
,
"CAN'
T
OPEN INDEX %u - SKIP IT"
,
ioid
[
i
]);
}
*
nindices
=
k
;
pfree
(
ioid
);
...
...
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