forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5dc0418
committed
Prefetch data referenced by the WAL, take II.
Introduce a new GUC recovery_prefetch. When enabled, look ahead in theWAL and try to initiate asynchronous reading of referenced data blocksthat are not yet cached in our buffer pool. For now, this is done withposix_fadvise(), which has several caveats. Since not all OSes havethat system call, "try" is provided so that it can be enabled whereavailable. Better mechanisms for asynchronous I/O are possible in laterwork.Set to "try" for now for test coverage. Default setting to be finalizedbefore release.The GUC wal_decode_buffer_size limits the distance we can look ahead inbytes of decoded data.The existing GUC maintenance_io_concurrency is used to limit the numberof concurrent I/Os allowed, based on pessimistic heuristics used toinfer that I/Os have begun and completed. We'll also not look more thanmaintenance_io_concurrency * 4 block references ahead.Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com>Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com> (earlier version)Reviewed-by: Andres Freund <andres@anarazel.de> (earlier version)Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> (earlier version)Tested-by: Tomas Vondra <tomas.vondra@2ndquadrant.com> (earlier version)Tested-by: Jakub Wartak <Jakub.Wartak@tomtom.com> (earlier version)Tested-by: Dmitry Dolgov <9erthalion6@gmail.com> (earlier version)Tested-by: Sait Talha Nisanci <Sait.Nisanci@microsoft.com> (earlier version)Discussion:https://postgr.es/m/CA%2BhUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq%3DAovOddfHpA%40mail.gmail.com1 parent9553b41 commit5dc0418
File tree
27 files changed
+1595
-77
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- storage
- buffer
- freespace
- ipc
- smgr
- utils
- adt
- misc
- include
- access
- catalog
- utils
- test/regress/expected
- tools/pgindent
27 files changed
+1595
-77
lines changedLines changed: 64 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3657 | 3657 |
| |
3658 | 3658 |
| |
3659 | 3659 |
| |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
3660 | 3724 |
| |
3661 | 3725 |
| |
3662 | 3726 |
| |
|
Lines changed: 84 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
331 | 338 |
| |
332 | 339 |
| |
333 | 340 |
| |
| |||
2979 | 2986 |
| |
2980 | 2987 |
| |
2981 | 2988 |
| |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
2982 | 3061 |
| |
2983 | 3062 |
| |
2984 | 3063 |
| |
| |||
5199 | 5278 |
| |
5200 | 5279 |
| |
5201 | 5280 |
| |
5202 |
| - | |
5203 |
| - | |
| 5281 | + | |
| 5282 | + | |
| 5283 | + | |
| 5284 | + | |
| 5285 | + | |
5204 | 5286 |
| |
5205 | 5287 |
| |
5206 | 5288 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
803 | 803 |
| |
804 | 804 |
| |
805 | 805 |
| |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
806 | 818 |
| |
807 | 819 |
| |
808 | 820 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| |||
133 | 134 |
| |
134 | 135 |
| |
135 | 136 |
| |
| 137 | + | |
136 | 138 |
| |
137 | 139 |
| |
138 | 140 |
| |
|
0 commit comments
Comments
(0)