pgsql: Simplify/speed up assertion cross-check in ginCompressPostingLis

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify/speed up assertion cross-check in ginCompressPostingLis
Date: 2020-03-07 18:31:47
Message-ID: E1jAeEl-0000lH-Mz@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify/speed up assertion cross-check in ginCompressPostingList().

I noticed while testing some other stuff that the CHECK_ENCODING_ROUNDTRIP
logic in ginCompressPostingList could account for over 50% of the runtime
of an INSERT with a GIN index. While that's not relevant to production
performance, it's still kind of annoying in a debug build. Replacing
the loop around short memcmp's with one long memcmp works just as well
and is significantly faster, at least on my machine.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ea7dace2aa21e79a7a8eb23c493bcd2057d9bd7e

Modified Files
--------------
src/backend/access/gin/ginpostinglist.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-03-07 21:58:12 pgsql: Tab completion: offer parens as appropriate in CREATE/ALTER TEXT
Previous Message Peter Eisentraut 2020-03-07 13:06:23 pgsql: doc: Remove unused ids