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
267ef0a6
Commit
267ef0a6
authored
Oct 03, 1996
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow vacuum to run for only one table. Fixes allocation bug.
parent
dbc268ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+25
-15
No files found.
src/backend/commands/vacuum.c
View file @
267ef0a6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.
1.1.1 1996/07/09 06:21:22 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.
2 1996/10/03 04:19:29 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -44,10 +44,10 @@
bool
VacuumRunning
=
false
;
/* non-export function prototypes */
static
void
_vc_init
(
char
*
vacrel
);
static
void
_vc_shutdown
(
char
*
vacrel
);
static
void
_vc_vacuum
(
char
*
vacrel
);
static
VRelList
_vc_getrels
(
Portal
p
,
char
*
vacrel
);
static
void
_vc_init
(
void
);
static
void
_vc_shutdown
(
void
);
static
void
_vc_vacuum
(
NameData
*
VacRelP
);
static
VRelList
_vc_getrels
(
Portal
p
,
NameData
*
VacRelP
);
static
void
_vc_vacone
(
Portal
p
,
VRelList
curvrl
);
static
void
_vc_vacheap
(
Portal
p
,
VRelList
curvrl
,
Relation
onerel
);
static
void
_vc_vacindices
(
VRelList
curvrl
,
Relation
onerel
);
...
...
@@ -65,14 +65,24 @@ static bool _vc_isarchrel(char *rname);
void
vacuum
(
char
*
vacrel
)
{
NameData
VacRel
;
/* vacrel gets de-allocated on transaction commit */
/* initialize vacuum cleaner */
_vc_init
(
vacrel
);
_vc_init
();
/* vacuum the database */
_vc_vacuum
(
vacrel
);
if
(
vacrel
)
{
strcpy
(
VacRel
.
data
,
vacrel
);
_vc_vacuum
(
&
VacRel
);
}
else
_vc_vacuum
(
NULL
);
/* clean up */
_vc_shutdown
(
vacrel
);
_vc_shutdown
();
}
/*
...
...
@@ -93,7 +103,7 @@ vacuum(char *vacrel)
* PostgresMain().
*/
static
void
_vc_init
(
char
*
vacrel
)
_vc_init
()
{
int
fd
;
...
...
@@ -116,7 +126,7 @@ _vc_init(char *vacrel)
}
static
void
_vc_shutdown
(
char
*
vacrel
)
_vc_shutdown
()
{
/* on entry, not in a transaction */
if
(
unlink
(
"pg_vlock"
)
<
0
)
...
...
@@ -147,7 +157,7 @@ vc_abort()
* locks at one time.
*/
static
void
_vc_vacuum
(
char
*
vacrel
)
_vc_vacuum
(
NameData
*
VacRelP
)
{
VRelList
vrl
,
cur
;
char
*
pname
;
...
...
@@ -166,7 +176,7 @@ _vc_vacuum(char *vacrel)
pfree
(
pname
);
/* get list of relations */
vrl
=
_vc_getrels
(
p
,
vacrel
);
vrl
=
_vc_getrels
(
p
,
VacRelP
);
/* vacuum each heap relation */
for
(
cur
=
vrl
;
cur
!=
(
VRelList
)
NULL
;
cur
=
cur
->
vrl_next
)
...
...
@@ -178,7 +188,7 @@ _vc_vacuum(char *vacrel)
}
static
VRelList
_vc_getrels
(
Portal
p
,
char
*
vacrel
)
_vc_getrels
(
Portal
p
,
NameData
*
VacRelP
)
{
Relation
pgclass
;
TupleDesc
pgcdesc
;
...
...
@@ -196,10 +206,10 @@ _vc_getrels(Portal p, char *vacrel)
StartTransactionCommand
();
if
(
vacrel
)
{
if
(
VacRelP
->
data
)
{
ScanKeyEntryInitialize
(
&
pgckey
,
0x0
,
Anum_pg_class_relname
,
NameEqualRegProcedure
,
PointerGetDatum
(
vacrel
));
PointerGetDatum
(
VacRelP
->
data
));
}
else
{
ScanKeyEntryInitialize
(
&
pgckey
,
0x0
,
Anum_pg_class_relkind
,
CharacterEqualRegProcedure
,
CharGetDatum
(
'r'
));
...
...
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