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
1ecb43a4
Commit
1ecb43a4
authored
Aug 09, 1999
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-use free space on index pages with duplicates.
parent
10d6d411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
20 deletions
+9
-20
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+9
-20
No files found.
src/backend/access/nbtree/nbtinsert.c
View file @
1ecb43a4
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.
49 1999/07/19 07:07:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.
50 1999/08/09 01:39:19 vadim
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -392,17 +392,18 @@ _bt_insertonpg(Relation rel,
bool
is_root
=
lpageop
->
btpo_flags
&
BTP_ROOT
;
/*
* I
f we have to split leaf page in the chain of duplicates by new
*
duplicate then we try to look at our right sibling first
.
* I
nstead of splitting leaf page in the chain of duplicates
*
by new duplicate, insert it into some right page
.
*/
if
((
lpageop
->
btpo_flags
&
BTP_CHAIN
)
&&
(
lpageop
->
btpo_flags
&
BTP_LEAF
)
&&
keys_equal
)
{
bool
use_left
=
true
;
rbuf
=
_bt_getbuf
(
rel
,
lpageop
->
btpo_next
,
BT_WRITE
);
rpage
=
BufferGetPage
(
rbuf
);
rpageop
=
(
BTPageOpaque
)
PageGetSpecialPointer
(
rpage
);
/*
* some checks
*/
if
(
!
P_RIGHTMOST
(
rpageop
))
/* non-rightmost page */
{
/* If we have the same hikey here then
* it's yet another page in chain. */
...
...
@@ -418,32 +419,20 @@ _bt_insertonpg(Relation rel,
BTGreaterStrategyNumber
))
elog
(
FATAL
,
"btree: hikey is out of order"
);
else
if
(
rpageop
->
btpo_flags
&
BTP_CHAIN
)
/*
* If hikey > scankey then it's last page in chain and
* BTP_CHAIN must be OFF
*/
elog
(
FATAL
,
"btree: lost last page in the chain of duplicates"
);
/* if there is room here then we use this page. */
if
(
PageGetFreeSpace
(
rpage
)
>
itemsz
)
use_left
=
false
;
}
else
/* rightmost page */
{
Assert
(
!
(
rpageop
->
btpo_flags
&
BTP_CHAIN
));
/* if there is room here then we use this page. */
if
(
PageGetFreeSpace
(
rpage
)
>
itemsz
)
use_left
=
false
;
}
if
(
!
use_left
)
/* insert on the right page */
{
_bt_relbuf
(
rel
,
buf
,
BT_WRITE
);
return
(
_bt_insertonpg
(
rel
,
rbuf
,
stack
,
keysz
,
scankey
,
btitem
,
afteritem
));
}
_bt_relbuf
(
rel
,
rbuf
,
BT_WRITE
);
_bt_relbuf
(
rel
,
buf
,
BT_WRITE
);
return
(
_bt_insertonpg
(
rel
,
rbuf
,
stack
,
keysz
,
scankey
,
btitem
,
afteritem
));
}
/*
...
...
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