aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2020-04-07 15:56:52 -0700
committerPeter Geoghegan <pg@bowt.ie>2020-04-07 15:56:52 -0700
commit60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70 (patch)
tree26f89ab0572c1c9f8e6dec25fad8de7f90fc1ec1 /src/backend
parentc6550776394e25c1620bc8258427c8f1d448080d (diff)
downloadpostgresql-60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70.tar.gz
postgresql-60cbd7751c1ec6ffdf2ffc520ddeb35cb2f2ed70.zip
Remove nbtree BTreeTupleSetAltHeapTID() function.
Since heap TID is supposed to be just another key attribute to the implementation, it doesn't make much sense to have separate BTreeTupleSetNAtts() and BTreeTupleSetAltHeapTID() functions. Merge the two functions together. This slightly simplifies _bt_truncate().
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/nbtree/nbtinsert.c4
-rw-r--r--src/backend/access/nbtree/nbtsort.c4
-rw-r--r--src/backend/access/nbtree/nbtutils.c10
3 files changed, 10 insertions, 8 deletions
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index 1675298f73d..cbd4ec3b39e 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -2413,7 +2413,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
left_item = (IndexTuple) palloc(left_item_sz);
left_item->t_info = left_item_sz;
BTreeTupleSetDownLink(left_item, lbkno);
- BTreeTupleSetNAtts(left_item, 0);
+ BTreeTupleSetNAtts(left_item, 0, false);
/*
* Create downlink item for right page. The key for it is obtained from
@@ -2571,7 +2571,7 @@ _bt_pgaddtup(Page page,
{
trunctuple = *itup;
trunctuple.t_info = sizeof(IndexTupleData);
- BTreeTupleSetNAtts(&trunctuple, 0);
+ BTreeTupleSetNAtts(&trunctuple, 0, false);
itup = &trunctuple;
itemsize = sizeof(IndexTupleData);
}
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index 29a6f5ade61..9d249f7a6b6 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -771,7 +771,7 @@ _bt_sortaddtup(Page page,
{
trunctuple = *itup;
trunctuple.t_info = sizeof(IndexTupleData);
- BTreeTupleSetNAtts(&trunctuple, 0);
+ BTreeTupleSetNAtts(&trunctuple, 0, false);
itup = &trunctuple;
itemsize = sizeof(IndexTupleData);
}
@@ -1045,7 +1045,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup,
Assert(state->btps_lowkey == NULL);
state->btps_lowkey = palloc0(sizeof(IndexTupleData));
state->btps_lowkey->t_info = sizeof(IndexTupleData);
- BTreeTupleSetNAtts(state->btps_lowkey, 0);
+ BTreeTupleSetNAtts(state->btps_lowkey, 0, false);
}
/*
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 86cec248593..08d7201f196 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -2239,7 +2239,7 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
*/
if (keepnatts <= nkeyatts)
{
- BTreeTupleSetNAtts(pivot, keepnatts);
+ BTreeTupleSetNAtts(pivot, keepnatts, false);
return pivot;
}
@@ -2262,11 +2262,13 @@ _bt_truncate(Relation rel, IndexTuple lastleft, IndexTuple firstright,
/* Cannot leak memory here */
pfree(pivot);
- /* Store heap TID in enlarged pivot tuple */
+ /*
+ * Store all of firstright's key attribute values plus a tiebreaker heap
+ * TID value in enlarged pivot tuple
+ */
tidpivot->t_info &= ~INDEX_SIZE_MASK;
tidpivot->t_info |= newsize;
- BTreeTupleSetNAtts(tidpivot, nkeyatts);
- BTreeTupleSetAltHeapTID(tidpivot);
+ BTreeTupleSetNAtts(tidpivot, nkeyatts, true);
pivotheaptid = BTreeTupleGetHeapTID(tidpivot);
/*