diff options
Diffstat (limited to 'src/backend/utils/sort/tuplesort.c')
-rw-r--r-- | src/backend/utils/sort/tuplesort.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index 16bda5c586a..3eebd9ef51c 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -4057,9 +4057,10 @@ comparetup_index_btree(const SortTuple *a, const SortTuple *b, } /* - * If key values are equal, we sort on ItemPointer. This does not affect - * validity of the finished index, but it may be useful to have index - * scans in physical order. + * If key values are equal, we sort on ItemPointer. This is required for + * btree indexes, since heap TID is treated as an implicit last key + * attribute in order to ensure that all keys in the index are physically + * unique. */ { BlockNumber blk1 = ItemPointerGetBlockNumber(&tuple1->t_tid); @@ -4076,6 +4077,9 @@ comparetup_index_btree(const SortTuple *a, const SortTuple *b, return (pos1 < pos2) ? -1 : 1; } + /* ItemPointer values should never be equal */ + Assert(false); + return 0; } @@ -4128,6 +4132,9 @@ comparetup_index_hash(const SortTuple *a, const SortTuple *b, return (pos1 < pos2) ? -1 : 1; } + /* ItemPointer values should never be equal */ + Assert(false); + return 0; } |