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

Commit61b22d3

Browse files
committed
btree page recycling can be done as soon as page's next-xact label is
older than current Xmin; we don't have to wait till it's older thanGlobalXmin.
1 parent3bbd6af commit61b22d3

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

‎src/backend/access/nbtree/nbtpage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.62 2003/02/2322:43:08 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.63 2003/02/2323:20:52 tgl Exp $
1313
*
1414
*NOTES
1515
* Postgres btree pages look like ordinary relation pages.The opaque
@@ -544,7 +544,7 @@ _bt_page_recyclable(Page page)
544544
*/
545545
opaque= (BTPageOpaque)PageGetSpecialPointer(page);
546546
if (P_ISDELETED(opaque)&&
547-
TransactionIdPrecedesOrEquals(opaque->btpo.xact,RecentGlobalXmin))
547+
TransactionIdPrecedesOrEquals(opaque->btpo.xact,RecentXmin))
548548
return true;
549549
return false;
550550
}

‎src/backend/storage/ipc/sinval.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.53 2002/11/21 06:36:08 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.54 2003/02/23 23:20:52 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -298,9 +298,10 @@ GetOldestXmin(bool allDbs)
298298
* This ensures that the set of transactions seen as "running" by the
299299
* current xact will not change after it takes the snapshot.
300300
*
301-
*Also, we compute the current global xmin (oldest xmin across all running
301+
*We also compute the current global xmin (oldest xmin across all running
302302
* transactions) and save it in RecentGlobalXmin. This is the same
303-
* computation done by GetOldestXmin(TRUE).
303+
* computation done by GetOldestXmin(TRUE). The xmin value is also stored
304+
* into RecentXmin.
304305
*----------
305306
*/
306307
Snapshot
@@ -419,7 +420,9 @@ GetSnapshotData(bool serializable)
419420
if (TransactionIdPrecedes(xmin,globalxmin))
420421
globalxmin=xmin;
421422

423+
/* Update globals for use by VACUUM */
422424
RecentGlobalXmin=globalxmin;
425+
RecentXmin=xmin;
423426

424427
snapshot->xmin=xmin;
425428
snapshot->xmax=xmax;

‎src/backend/utils/time/tqual.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Portions Copyright (c) 1994, Regents of the University of California
1717
*
1818
* IDENTIFICATION
19-
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.61 2002/10/08 17:17:19 tgl Exp $
19+
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.62 2003/02/23 23:20:52 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -33,7 +33,8 @@ SnapshotSnapshotDirty = &SnapshotDirtyData;
3333
SnapshotQuerySnapshot=NULL;
3434
SnapshotSerializableSnapshot=NULL;
3535

36-
/* This is updated by GetSnapshotData: */
36+
/* These are updated by GetSnapshotData: */
37+
TransactionIdRecentXmin=InvalidTransactionId;
3738
TransactionIdRecentGlobalXmin=InvalidTransactionId;
3839

3940
boolReferentialIntegritySnapshotOverride= false;

‎src/include/utils/tqual.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: tqual.h,v 1.43 2002/09/0420:31:46 momjian Exp $
11+
* $Id: tqual.h,v 1.44 2003/02/23 23:20:52 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -41,6 +41,7 @@ extern DLLIMPORT Snapshot SnapshotDirty;
4141
externDLLIMPORTSnapshotQuerySnapshot;
4242
externDLLIMPORTSnapshotSerializableSnapshot;
4343

44+
externTransactionIdRecentXmin;
4445
externTransactionIdRecentGlobalXmin;
4546

4647
externboolReferentialIntegritySnapshotOverride;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp