Skip to content

Commit abba8f5

Browse files
author
Artur Zakirov
committed
Use iptr of RumSortItem
1 parent 1d4c316 commit abba8f5

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

rumsort.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,8 +3849,6 @@ comparetup_rum(const SortTuple *a, const SortTuple *b, Tuplesortstate *state)
38493849
float8 v1 = DatumGetFloat8(a->datum1);
38503850
float8 v2 = DatumGetFloat8(b->datum1);
38513851
int i;
3852-
IndexTuple tuple1;
3853-
IndexTuple tuple2;
38543852

38553853
if (v1 < v2)
38563854
return -1;
@@ -3868,22 +3866,18 @@ comparetup_rum(const SortTuple *a, const SortTuple *b, Tuplesortstate *state)
38683866
}
38693867

38703868
/*
3871-
* If key values are equal, we sort on ItemPointer. This does not affect
3872-
* validity of the finished index, but it may be useful to have index
3873-
* scans in physical order.
3869+
* If key values are equal, we sort on ItemPointer.
38743870
*/
3875-
tuple1 = (IndexTuple) a->tuple;
3876-
tuple2 = (IndexTuple) b->tuple;
38773871
{
3878-
BlockNumber blk1 = ItemPointerGetBlockNumber(&tuple1->t_tid);
3879-
BlockNumber blk2 = ItemPointerGetBlockNumber(&tuple2->t_tid);
3872+
BlockNumber blk1 = ItemPointerGetBlockNumber(&i1->iptr);
3873+
BlockNumber blk2 = ItemPointerGetBlockNumber(&i2->iptr);
38803874

38813875
if (blk1 != blk2)
38823876
return (blk1 < blk2) ? -1 : 1;
38833877
}
38843878
{
3885-
OffsetNumber pos1 = ItemPointerGetOffsetNumber(&tuple1->t_tid);
3886-
OffsetNumber pos2 = ItemPointerGetOffsetNumber(&tuple2->t_tid);
3879+
OffsetNumber pos1 = ItemPointerGetOffsetNumber(&i1->iptr);
3880+
OffsetNumber pos2 = ItemPointerGetOffsetNumber(&i2->iptr);
38873881

38883882
if (pos1 != pos2)
38893883
return (pos1 < pos2) ? -1 : 1;

0 commit comments

Comments
 (0)