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

Commitea7dace

Browse files
committed
Simplify/speed up assertion cross-check in ginCompressPostingList().
I noticed while testing some other stuff that the CHECK_ENCODING_ROUNDTRIPlogic in ginCompressPostingList could account for over 50% of the runtimeof an INSERT with a GIN index. While that's not relevant to productionperformance, it's still kind of annoying in a debug build. Replacingthe loop around short memcmp's with one long memcmp works just as welland is significantly faster, at least on my machine.
1 parent7e39b96 commitea7dace

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎src/backend/access/gin/ginpostinglist.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,9 @@ ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize,
266266
{
267267
intndecoded;
268268
ItemPointertmp=ginPostingListDecode(result,&ndecoded);
269-
inti;
270269

271270
Assert(ndecoded==totalpacked);
272-
for (i=0;i<ndecoded;i++)
273-
Assert(memcmp(&tmp[i],&ipd[i],sizeof(ItemPointerData))==0);
271+
Assert(memcmp(tmp,ipd,ndecoded*sizeof(ItemPointerData))==0);
274272
pfree(tmp);
275273
}
276274
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp