aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogfuncs.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-03-10 15:19:37 +0100
committerPeter Eisentraut <peter@eisentraut.org>2021-03-10 15:19:37 +0100
commitbbaf315309ed1194d451326cc8f4f59a45906408 (patch)
tree086b59d6168704bc646bc5901422b31dd29fd487 /src/backend/access/transam/xlogfuncs.c
parentc427de427ac411039d5efd5d0dcc8a4e0c6da68d (diff)
downloadpostgresql-bbaf315309ed1194d451326cc8f4f59a45906408.tar.gz
postgresql-bbaf315309ed1194d451326cc8f4f59a45906408.zip
Add bound check before bsearch() for performance
In the current lazy vacuum implementation, some index AMs such as btree indexes call lazy_tid_reaped() for each index tuple during ambulkdelete to check if the index tuple points to the (collected) garbage tuple. In that function, we simply call bsearch(), but we should be able to know the result without bsearch() if the index tuple points to the heap tuple that is out of range of the collected garbage tuples. Therefore, add a simple bound check before resorting to bsearch(). Testing has shown that this can give significant performance benefits. Author: Masahiko Sawada <masahiko.sawada@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/flat/CA+fd4k76j8jKzJzcx8UqEugvayaMSnQz0iLUt_XgBp-_-bd22A@mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/xlogfuncs.c')
0 files changed, 0 insertions, 0 deletions