Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
6a10f0f7
Commit
6a10f0f7
authored
17 years ago
by
Alvaro Herrera
Browse files
Options
Downloads
Patches
Plain Diff
Release the exclusive lock on the table early after truncating it in lazy
vacuum, instead of waiting till commit.
parent
f7379f5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/commands/vacuumlazy.c
+4
-5
4 additions, 5 deletions
src/backend/commands/vacuumlazy.c
with
4 additions
and
5 deletions
src/backend/commands/vacuumlazy.c
+
4
−
5
View file @
6a10f0f7
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.9
2
2007/09/10
17:58:45
alvherre Exp $
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.9
3
2007/09/10
21:40:03
alvherre Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -802,6 +802,9 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
...
@@ -802,6 +802,9 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
*/
*/
RelationTruncate
(
onerel
,
new_rel_pages
);
RelationTruncate
(
onerel
,
new_rel_pages
);
/* Now we're OK to release the lock. */
UnlockRelation
(
onerel
,
AccessExclusiveLock
);
/*
/*
* Drop free-space info for removed blocks; these must not get entered
* Drop free-space info for removed blocks; these must not get entered
* into the FSM!
* into the FSM!
...
@@ -834,10 +837,6 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
...
@@ -834,10 +837,6 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
vacrelstats
->
rel_pages
=
new_rel_pages
;
vacrelstats
->
rel_pages
=
new_rel_pages
;
vacrelstats
->
pages_removed
=
old_rel_pages
-
new_rel_pages
;
vacrelstats
->
pages_removed
=
old_rel_pages
-
new_rel_pages
;
/*
* We keep the exclusive lock until commit (perhaps not necessary)?
*/
ereport
(
elevel
,
ereport
(
elevel
,
(
errmsg
(
"
\"
%s
\"
: truncated %u to %u pages"
,
(
errmsg
(
"
\"
%s
\"
: truncated %u to %u pages"
,
RelationGetRelationName
(
onerel
),
RelationGetRelationName
(
onerel
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment