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
9c7fb7e6
Commit
9c7fb7e6
authored
Mar 29, 2019
by
Peter Geoghegan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak some nbtree-related code comments.
parent
d85e0f36
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
contrib/amcheck/verify_nbtree.c
contrib/amcheck/verify_nbtree.c
+1
-1
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtsearch.c
+2
-1
src/backend/access/nbtree/nbtsort.c
src/backend/access/nbtree/nbtsort.c
+3
-3
src/include/access/nbtree.h
src/include/access/nbtree.h
+5
-6
No files found.
contrib/amcheck/verify_nbtree.c
View file @
9c7fb7e6
...
@@ -1975,7 +1975,7 @@ bt_normalize_tuple(BtreeCheckState *state, IndexTuple itup)
...
@@ -1975,7 +1975,7 @@ bt_normalize_tuple(BtreeCheckState *state, IndexTuple itup)
/*
/*
* Search for itup in index, starting from fast root page. itup must be a
* Search for itup in index, starting from fast root page. itup must be a
* non-pivot tuple. This is only supported with heapkeyspace indexes, since
* non-pivot tuple. This is only supported with heapkeyspace indexes, since
* we rely on having fully unique keys to find a match with only a si
gn
le
* we rely on having fully unique keys to find a match with only a si
ng
le
* visit to a leaf page, barring an interrupted page split, where we may have
* visit to a leaf page, barring an interrupted page split, where we may have
* to move right. (A concurrent page split is impossible because caller must
* to move right. (A concurrent page split is impossible because caller must
* be readonly caller.)
* be readonly caller.)
...
...
src/backend/access/nbtree/nbtsearch.c
View file @
9c7fb7e6
...
@@ -182,7 +182,8 @@ _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access,
...
@@ -182,7 +182,8 @@ _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access,
/*
/*
* If we're asked to lock leaf in write mode, but didn't manage to, then
* If we're asked to lock leaf in write mode, but didn't manage to, then
* relock. That may happen when the root page appears to be leaf.
* relock. This should only happen when the root page is a leaf page (and
* the only page in the index other than the metapage).
*/
*/
if
(
access
==
BT_WRITE
&&
page_access
==
BT_READ
)
if
(
access
==
BT_WRITE
&&
page_access
==
BT_READ
)
{
{
...
...
src/backend/access/nbtree/nbtsort.c
View file @
9c7fb7e6
...
@@ -835,7 +835,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
...
@@ -835,7 +835,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
* the limit on the size of tuples inserted on the leaf level by the same
* the limit on the size of tuples inserted on the leaf level by the same
* small amount. Enforce the new v4+ limit on the leaf level, and the old
* small amount. Enforce the new v4+ limit on the leaf level, and the old
* limit on internal levels, since pivot tuples may need to make use of
* limit on internal levels, since pivot tuples may need to make use of
* the resered space. This should never fail on internal pages.
* the reser
v
ed space. This should never fail on internal pages.
*/
*/
if
(
unlikely
(
itupsz
>
BTMaxItemSize
(
npage
)))
if
(
unlikely
(
itupsz
>
BTMaxItemSize
(
npage
)))
_bt_check_third_page
(
wstate
->
index
,
wstate
->
heap
,
_bt_check_third_page
(
wstate
->
index
,
wstate
->
heap
,
...
@@ -907,8 +907,8 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
...
@@ -907,8 +907,8 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
* choosing a split point here for a benefit that is bound to be
* choosing a split point here for a benefit that is bound to be
* much smaller.
* much smaller.
*
*
* Since the truncated tuple is
probably smaller than the
* Since the truncated tuple is
often smaller than the original
*
original
, it cannot just be copied in place (besides, we want
*
tuple
, it cannot just be copied in place (besides, we want
* to actually save space on the leaf page). We delete the
* to actually save space on the leaf page). We delete the
* original high key, and add our own truncated high key at the
* original high key, and add our own truncated high key at the
* same offset. It's okay if the truncated tuple is slightly
* same offset. It's okay if the truncated tuple is slightly
...
...
src/include/access/nbtree.h
View file @
9c7fb7e6
...
@@ -219,7 +219,6 @@ typedef struct BTMetaPageData
...
@@ -219,7 +219,6 @@ typedef struct BTMetaPageData
#define P_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY)
#define P_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY)
/*
/*
*
* Notes on B-Tree tuple format, and key and non-key attributes:
* Notes on B-Tree tuple format, and key and non-key attributes:
*
*
* INCLUDE B-Tree indexes have non-key attributes. These are extra
* INCLUDE B-Tree indexes have non-key attributes. These are extra
...
@@ -321,7 +320,7 @@ typedef struct BTMetaPageData
...
@@ -321,7 +320,7 @@ typedef struct BTMetaPageData
/*
/*
* Get/set number of attributes within B-tree index tuple.
* Get/set number of attributes within B-tree index tuple.
*
*
* Note that this does not include an implicit tiebreaker heap
-
TID
* Note that this does not include an implicit tiebreaker heap
TID
* attribute, if any. Note also that the number of key attributes must be
* attribute, if any. Note also that the number of key attributes must be
* explicitly represented in all heapkeyspace pivot tuples.
* explicitly represented in all heapkeyspace pivot tuples.
*/
*/
...
@@ -424,10 +423,10 @@ typedef struct BTStackData
...
@@ -424,10 +423,10 @@ typedef struct BTStackData
typedef
BTStackData
*
BTStack
;
typedef
BTStackData
*
BTStack
;
/*
/*
* BTScanInsert
is the btree-private state needed to find an initial position
* BTScanInsert
Data is the btree-private state needed to find an initial
*
for an indexscan, or to insert new tuples -- an "insertion scankey" (not to
*
position for an indexscan, or to insert new tuples -- an "insertion
*
be confused with a search scankey). It's used to descend a B-Tree using
*
scankey" (not to be confused with a search scankey). It's used to descend
* _bt_search.
*
a B-Tree using
_bt_search.
*
*
* heapkeyspace indicates if we expect all keys in the index to be physically
* heapkeyspace indicates if we expect all keys in the index to be physically
* unique because heap TID is used as a tiebreaker attribute, and if index may
* unique because heap TID is used as a tiebreaker attribute, and if index may
...
...
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