- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit06eae9e
committed
Trigger more frequent autovacuums with relallfrozen
Calculate the insert threshold for triggering an autovacuum of arelation based on the number of unfrozen pages.By only considering the unfrozen portion of the table when calculatinghow many tuples to add to the insert threshold, we can trigger morefrequent vacuums of insert-heavy tables. This increases the chances ofvacuuming those pages when they still reside in shared buffersThis also increases the number of autovacuums triggered by tuplesinserted and not by wraparound risk. We prefer to freeze these pagesduring insert-triggered autovacuums, as anti-wraparound vacuums are notautomatically canceled by conflicting lock requests.We calculate the unfrozen percentage of the table using the recentlyadded (99f8f3f) relallfrozen column of pg_class.Author: Melanie Plageman <melanieplageman@gmail.com>Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com>Reviewed-by: Robert Treat <rob@xzilla.net>Reviewed-by: wenhui qiu <qiuwenhuifx@gmail.com>Discussion:https://postgr.es/m/flat/CAAKRu_aj-P7YyBz_cPNwztz6ohP%2BvWis%3Diz3YcomkB3NpYA--w%40mail.gmail.com1 parent35c8dd9 commit06eae9e
File tree
4 files changed
+37
-16
lines changed- doc/src/sgml
- src/backend
- postmaster
- utils/misc
4 files changed
+37
-16
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2072 | 2072 |
| |
2073 | 2073 |
| |
2074 | 2074 |
| |
2075 |
| - | |
2076 |
| - | |
2077 |
| - | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
2078 | 2079 |
| |
2079 | 2080 |
| |
2080 | 2081 |
| |
|
Lines changed: 7 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8773 | 8773 |
| |
8774 | 8774 |
| |
8775 | 8775 |
| |
8776 |
| - | |
8777 |
| - | |
8778 |
| - | |
8779 |
| - | |
8780 |
| - | |
8781 |
| - | |
8782 |
| - | |
8783 |
| - | |
| 8776 | + | |
| 8777 | + | |
| 8778 | + | |
| 8779 | + | |
| 8780 | + | |
| 8781 | + | |
| 8782 | + | |
8784 | 8783 |
| |
8785 | 8784 |
| |
8786 | 8785 |
| |
|
Lines changed: 24 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2938 | 2938 |
| |
2939 | 2939 |
| |
2940 | 2940 |
| |
2941 |
| - | |
2942 | 2941 |
| |
2943 | 2942 |
| |
2944 | 2943 |
| |
| |||
3052 | 3051 |
| |
3053 | 3052 |
| |
3054 | 3053 |
| |
3055 |
| - | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
3056 | 3059 |
| |
3057 | 3060 |
| |
3058 | 3061 |
| |
| |||
3061 | 3064 |
| |
3062 | 3065 |
| |
3063 | 3066 |
| |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
3064 | 3084 |
| |
3065 | 3085 |
| |
3066 | 3086 |
| |
3067 | 3087 |
| |
3068 |
| - | |
| 3088 | + | |
| 3089 | + | |
3069 | 3090 |
| |
3070 | 3091 |
| |
3071 | 3092 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
675 | 675 |
| |
676 | 676 |
| |
677 | 677 |
| |
678 |
| - | |
679 |
| - | |
| 678 | + | |
| 679 | + | |
680 | 680 |
| |
681 | 681 |
| |
682 | 682 |
| |
|
0 commit comments
Comments
(0)