forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbbaf315
committed
Add bound check before bsearch() for performance
In the current lazy vacuum implementation, some index AMs such asbtree indexes call lazy_tid_reaped() for each index tuple duringambulkdelete to check if the index tuple points to the (collected)garbage tuple. In that function, we simply call bsearch(), but weshould be able to know the result without bsearch() if the index tuplepoints to the heap tuple that is out of range of the collected garbagetuples. Therefore, add a simple bound check before resorting tobsearch(). Testing has shown that this can give significantperformance benefits.Author: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>Discussion:https://www.postgresql.org/message-id/flat/CA+fd4k76j8jKzJzcx8UqEugvayaMSnQz0iLUt_XgBp-_-bd22A@mail.gmail.com1 parentc427de4 commitbbaf315
1 file changed
+17
-0
lines changedLines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
| |||
2923 | 2924 |
| |
2924 | 2925 |
| |
2925 | 2926 |
| |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
2926 | 2930 |
| |
2927 | 2931 |
| |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
2928 | 2945 |
| |
2929 | 2946 |
| |
2930 | 2947 |
| |
|
0 commit comments
Comments
(0)