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
71b3e93c
Commit
71b3e93c
authored
Jun 10, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duplicates handling...
parent
3548a410
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
303 additions
and
124 deletions
+303
-124
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+283
-101
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtsearch.c
+20
-23
No files found.
src/backend/access/nbtree/nbtinsert.c
View file @
71b3e93c
This diff is collapsed.
Click to expand it.
src/backend/access/nbtree/nbtsearch.c
View file @
71b3e93c
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.2
0 1997/05/30 18:35:37
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.2
1 1997/06/10 07:28:50
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -159,6 +159,7 @@ _bt_moveright(Relation rel,
BTPageOpaque
opaque
;
ItemId
hikey
;
BlockNumber
rblkno
;
int
natts
=
rel
->
rd_rel
->
relnatts
;
page
=
BufferGetPage
(
buf
);
opaque
=
(
BTPageOpaque
)
PageGetSpecialPointer
(
page
);
...
...
@@ -195,26 +196,9 @@ _bt_moveright(Relation rel,
* on this page to do not lose "good" tuples if number
* of attrs > keysize. Example: (2,0) - last items on
* this page, (2,1) - first item on next page (hikey),
* our scankey is x = 2. Scankey
>
= (2,1) because of
* our scankey is x = 2. Scankey
=
= (2,1) because of
* we compare first attrs only, but we shouldn't to move
* right of here. - vadim 04/15/97
*
* XXX
* This code changed again! Actually, we break our
* duplicates handling in single case: if we insert
* new minimum key into leftmost page with duplicates
* and splitting doesn't occure then _bt_insertonpg doesn't
* worry about duplicates-rule. Fix _bt_insertonpg ?
* But I don't see why don't compare scankey with _last_
* item on the page instead of first one, in any cases.
* So - we do it in that way now. - vadim 05/26/97
*
* Also, if we are on an "pseudo-empty" leaf page (i.e. there is
* only hikey here) and scankey == hikey then we don't move
* right! It's fix for bug described in _bt_insertonpg(). It's
* right - at least till index cleanups are perfomed by vacuum
* in exclusive mode: so, though this page may be just splitted,
* it may not be "emptied" before we got here. - vadim 05/27/97
*/
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
hikey
,
...
...
@@ -227,14 +211,27 @@ _bt_moveright(Relation rel,
}
if
(
offmax
>
P_HIKEY
)
{
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
if
(
natts
==
keysz
)
/* sanity checks */
{
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
PageGetItemId
(
page
,
P_FIRSTKEY
),
BTEqualStrategyNumber
)
)
elog
(
FATAL
,
"btree: BTP_CHAIN flag was expected"
);
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
PageGetItemId
(
page
,
offmax
),
BTEqualStrategyNumber
)
)
elog
(
FATAL
,
"btree: unexpected equal last item"
);
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
PageGetItemId
(
page
,
offmax
),
BTLessStrategyNumber
)
)
elog
(
FATAL
,
"btree: unexpected greater last item"
);
/* move right */
}
else
if
(
_bt_skeycmp
(
rel
,
keysz
,
scankey
,
page
,
PageGetItemId
(
page
,
offmax
),
BTLessEqualStrategyNumber
)
)
break
;
}
else
if
(
offmax
==
P_HIKEY
&&
(
opaque
->
btpo_flags
&
BTP_LEAF
)
)
break
;
}
/* step right one page */
...
...
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