forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit306dc52
Introduce autovacuum_vacuum_max_threshold.
One way autovacuum chooses tables to vacuum is by comparing thenumber of updated or deleted tuples with a value calculated usingautovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor.The threshold specifies the base value for comparison, and thescale factor specifies the fraction of the table size to add to it.This strategy ensures that smaller tables are vacuumed after fewerupdates/deletes than larger tables, which is reasonable in manycases but can result in infrequent vacuums on very large tables.This is undesirable for a couple of reasons, such as very largetables incurring a huge amount of bloat between vacuums.This new parameter provides a way to set a limit on the valuecalculated with autovacuum_vacuum_threshold andautovacuum_vacuum_scale_factor so that very large tables arevacuumed more frequently. By default, it is set to 100,000,000tuples, but it can be disabled by setting it to -1. It can also beadjusted for individual tables by changing storage parameters.Author: Nathan Bossart <nathandbossart@gmail.com>Co-authored-by: Frédéric Yhuel <frederic.yhuel@dalibo.com>Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>Reviewed-by: Robert Haas <robertmhaas@gmail.com>Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>Reviewed-by: Michael Banck <mbanck@gmx.net>Reviewed-by: Joe Conway <mail@joeconway.com>Reviewed-by: Sami Imseih <samimseih@gmail.com>Reviewed-by: David Rowley <dgrowleyml@gmail.com>Reviewed-by: wenhui qiu <qiuwenhuifx@gmail.com>Reviewed-by: Vinícius Abrahão <vinnix.bsd@gmail.com>Reviewed-by: Robert Treat <rob@xzilla.net>Reviewed-by: Alena Rybakina <a.rybakina@postgrespro.ru>Discussion:https://postgr.es/m/956435f8-3b2f-47a6-8756-8c54ded61802%40dalibo.com1 parenta14707d commit306dc52
File tree
10 files changed
+82
-2
lines changed- doc/src/sgml
- ref
- src
- backend
- access/common
- postmaster
- utils/misc
- bin/psql
- include
- postmaster
- utils
10 files changed
+82
-2
lines changedLines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8685 | 8685 |
| |
8686 | 8686 |
| |
8687 | 8687 |
| |
| 8688 | + | |
| 8689 | + | |
| 8690 | + | |
| 8691 | + | |
| 8692 | + | |
| 8693 | + | |
| 8694 | + | |
| 8695 | + | |
| 8696 | + | |
| 8697 | + | |
| 8698 | + | |
| 8699 | + | |
| 8700 | + | |
| 8701 | + | |
| 8702 | + | |
| 8703 | + | |
| 8704 | + | |
| 8705 | + | |
| 8706 | + | |
| 8707 | + | |
| 8708 | + | |
| 8709 | + | |
| 8710 | + | |
| 8711 | + | |
8688 | 8712 |
| |
8689 | 8713 |
| |
8690 | 8714 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
895 | 895 |
| |
896 | 896 |
| |
897 | 897 |
| |
898 |
| - | |
| 898 | + | |
899 | 899 |
| |
900 |
| - | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
901 | 903 |
| |
902 | 904 |
| |
903 | 905 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1712 | 1712 |
| |
1713 | 1713 |
| |
1714 | 1714 |
| |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1715 | 1730 |
| |
1716 | 1731 |
| |
1717 | 1732 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
234 | 243 |
| |
235 | 244 |
| |
236 | 245 |
| |
| |||
1843 | 1852 |
| |
1844 | 1853 |
| |
1845 | 1854 |
| |
| 1855 | + | |
| 1856 | + | |
1846 | 1857 |
| |
1847 | 1858 |
| |
1848 | 1859 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
120 | 120 |
| |
121 | 121 |
| |
122 | 122 |
| |
| 123 | + | |
123 | 124 |
| |
124 | 125 |
| |
125 | 126 |
| |
| |||
2895 | 2896 |
| |
2896 | 2897 |
| |
2897 | 2898 |
| |
| 2899 | + | |
| 2900 | + | |
2898 | 2901 |
| |
2899 | 2902 |
| |
2900 | 2903 |
| |
| |||
2933 | 2936 |
| |
2934 | 2937 |
| |
2935 | 2938 |
| |
| 2939 | + | |
2936 | 2940 |
| |
2937 | 2941 |
| |
2938 | 2942 |
| |
| |||
2974 | 2978 |
| |
2975 | 2979 |
| |
2976 | 2980 |
| |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
2977 | 2986 |
| |
2978 | 2987 |
| |
2979 | 2988 |
| |
| |||
3047 | 3056 |
| |
3048 | 3057 |
| |
3049 | 3058 |
| |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
3050 | 3062 |
| |
3051 | 3063 |
| |
3052 | 3064 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3426 | 3426 |
| |
3427 | 3427 |
| |
3428 | 3428 |
| |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
3429 | 3438 |
| |
3430 | 3439 |
| |
3431 | 3440 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
670 | 670 |
| |
671 | 671 |
| |
672 | 672 |
| |
| 673 | + | |
| 674 | + | |
| 675 | + | |
673 | 676 |
| |
674 | 677 |
| |
675 | 678 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1368 | 1368 |
| |
1369 | 1369 |
| |
1370 | 1370 |
| |
| 1371 | + | |
1371 | 1372 |
| |
1372 | 1373 |
| |
1373 | 1374 |
| |
| |||
1384 | 1385 |
| |
1385 | 1386 |
| |
1386 | 1387 |
| |
| 1388 | + | |
1387 | 1389 |
| |
1388 | 1390 |
| |
1389 | 1391 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
| 312 | + | |
312 | 313 |
| |
313 | 314 |
| |
314 | 315 |
| |
|
0 commit comments
Comments
(0)