Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f55eba

Browse files
Make _bt_keep_natts_fast() use datum_image_eq().
An upcoming patch that adds deduplication to the nbtree AM will rely on_bt_keep_natts_fast() understanding that differences in TOAST inputstate can never affect its answer. In particular, two opclass-equaldatums (with opclasses deemed safe for deduplication) should never betreated as unequal by _bt_keep_natts_fast() due to TOAST inputdifferences.This also seems like a good idea on general principle. nbtsplitloc.cwill now occasionally make better decisions about where to split a leafpage. The behavior of _bt_keep_natts_fast() is now somewhat closer tothe behavior of _bt_keep_natts().Discussion:https://postgr.es/m/CAH2-Wzn3Ee49Gmxb7V1VJ3-AC8fWn-Fr8pfWQebHe8rYRxt5OQ@mail.gmail.com
1 parentdcb7d3c commit1f55eba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎src/backend/access/nbtree/nbtutils.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,9 +2303,7 @@ _bt_keep_natts(Relation rel, IndexTuple lastleft, IndexTuple firstright,
23032303
* The approach taken here usually provides the same answer as _bt_keep_natts
23042304
* will (for the same pair of tuples from a heapkeyspace index), since the
23052305
* majority of btree opclasses can never indicate that two datums are equal
2306-
* unless they're bitwise equal (once detoasted). Similarly, result may
2307-
* differ from the _bt_keep_natts result when either tuple has TOASTed datums,
2308-
* though this is barely possible in practice.
2306+
* unless they're bitwise equal after detoasting.
23092307
*
23102308
* These issues must be acceptable to callers, typically because they're only
23112309
* concerned about making suffix truncation as effective as possible without
@@ -2337,7 +2335,7 @@ _bt_keep_natts_fast(Relation rel, IndexTuple lastleft, IndexTuple firstright)
23372335
break;
23382336

23392337
if (!isNull1&&
2340-
!datumIsEqual(datum1,datum2,att->attbyval,att->attlen))
2338+
!datum_image_eq(datum1,datum2,att->attbyval,att->attlen))
23412339
break;
23422340

23432341
keepnatts++;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp