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

Commit519cd36

Browse files
committed
Get rid of page-level locking in btree-s.
BT_READ/BT_WRITE are BUFFER_LOCK_SHARE/BUFFER_LOCK_EXCLUSIVE now.Also get rid of #define BT_VERSION_1 - we use version 1 as defaultfor near two years now.
1 parent7d443a8 commit519cd36

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

‎src/include/access/nbtree.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: nbtree.h,v 1.25 1999/05/2516:13:32 momjian Exp $
9+
* $Id: nbtree.h,v 1.26 1999/05/2518:31:28 vadim Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -19,7 +19,7 @@
1919
#include<storage/page.h>
2020
#include<access/funcindex.h>
2121
#include<access/itup.h>
22-
#include<storage/buf.h>
22+
#include<storage/bufmgr.h>/* don't remove, required by BT_READ/BT_WRITE */
2323
#include<storage/itemptr.h>
2424

2525
/*
@@ -107,26 +107,17 @@ typedef BTScanOpaqueData *BTScanOpaque;
107107

108108
typedefstructBTItemData
109109
{
110-
#ifndefBTREE_VERSION_1
111-
Oidbti_oid;
112-
int32bti_dummy;/* padding to make bti_itup align at
113-
* 8-byte boundary */
114-
#endif
115110
IndexTupleDatabti_itup;
116111
}BTItemData;
117112

118113
typedefBTItemData*BTItem;
119114

120-
#ifdefBTREE_VERSION_1
121115
#defineBTItemSame(i1,i2) ( i1->bti_itup.t_tid.ip_blkid.bi_hi == \
122116
i2->bti_itup.t_tid.ip_blkid.bi_hi && \
123117
i1->bti_itup.t_tid.ip_blkid.bi_lo == \
124118
i2->bti_itup.t_tid.ip_blkid.bi_lo && \
125119
i1->bti_itup.t_tid.ip_posid == \
126120
i2->bti_itup.t_tid.ip_posid )
127-
#else
128-
#defineBTItemSame(i1,i2) ( i1->bti_oid == i2->bti_oid )
129-
#endif
130121

131122
/*
132123
*BTStackData -- As we descend a tree, we push the (key, pointer)
@@ -165,8 +156,8 @@ typedef struct BTPageState
165156
*requests for pages, in order to do locking correctly.
166157
*/
167158

168-
#defineBT_READ0
169-
#defineBT_WRITE1
159+
#defineBT_READBUFFER_LOCK_SHARE
160+
#defineBT_WRITEBUFFER_LOCK_EXCLUSIVE
170161

171162
/*
172163
*Similarly, the difference between insertion and non-insertion binary

‎src/include/config.h.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,6 @@ extern void srandom(unsigned int seed);
506506
*/
507507
#defineFASTBUILD/* access/nbtree/nbtsort.c */
508508

509-
/*
510-
* BTREE_VERSION_1: we must guarantee that all tuples in A LEVEL
511-
* are unique, not in ALL INDEX. So, we can use bti_itup->t_tid
512-
* as unique identifier for a given index tuple (logical position
513-
* within a level) and take off bti_oid & bti_dummy (8 bytes total)
514-
* from btree items.
515-
*/
516-
#defineBTREE_VERSION_1
517-
518509
/*
519510
* TBL_FREE_CMD_MEMORY: free memory allocated for an user query inside
520511
* transaction block after this query is done.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp