- Notifications
You must be signed in to change notification settings - Fork28
Commitd4cef0a
committed
Improve vacuum code to track minimum Xids per table instead of per database.
To this end, add a couple of columns to pg_class, relminxid and relvacuumxid,based on which we calculate the pg_database columns after each vacuum.We now force all databases to be vacuumed, even template ones. A backendnoticing too old a database (meaning pg_database.datminxid is in danger offalling behind Xid wraparound) will signal the postmaster, which in turn willstart an autovacuum iteration to process the offending database. In principlethis is only there to cope with frozen (non-connectable) databases withoutforcing users to set them to connectable, but it could force regular userdatabase to go through a database-wide vacuum at any time. Maybe we shouldwarn users about this somehow. Of course the real solution will be to useautovacuum all the time ;-)There are some additional improvements we could have in this area: for examplethe vacuum code could be smarter about not updating pg_database for each tablewhen called by autovacuum, and do it only once the whole autovacuum iterationis done.I updated the system catalogs documentation, but I didn't modify themaintenance section. Also having some regression tests for this would be nicebut it's not really a very straightforward thing to do.Catalog version bumped due to system catalog changes.1 parente627c9b commitd4cef0a
File tree
19 files changed
+543
-264
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- commands
- libpq
- postmaster
- utils/init
- include
- access
- catalog
- commands
- libpq
- storage
19 files changed
+543
-264
lines changedLines changed: 37 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
1639 | 1639 |
| |
1640 | 1640 |
| |
1641 | 1641 |
| |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1642 | 1666 |
| |
1643 | 1667 |
| |
1644 | 1668 |
| |
| |||
2022 | 2046 |
| |
2023 | 2047 |
| |
2024 | 2048 |
| |
2025 |
| - | |
2026 |
| - | |
2027 |
| - | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
2028 | 2055 |
| |
2029 | 2056 |
| |
2030 | 2057 |
| |
2031 | 2058 |
| |
2032 |
| - | |
| 2059 | + | |
2033 | 2060 |
| |
2034 | 2061 |
| |
2035 | 2062 |
| |
| 2063 | + | |
2036 | 2064 |
| |
2037 | 2065 |
| |
2038 |
| - | |
2039 |
| - | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2040 | 2070 |
| |
2041 | 2071 |
| |
2042 | 2072 |
| |
|
Lines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
171 |
| - | |
| 171 | + | |
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
175 |
| - | |
| 175 | + | |
176 | 176 |
| |
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
182 | 182 |
| |
183 |
| - | |
| 183 | + | |
184 | 184 |
| |
185 | 185 |
| |
186 | 186 |
| |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
191 | 191 |
| |
192 |
| - | |
| 192 | + | |
193 | 193 |
| |
194 | 194 |
| |
195 | 195 |
| |
|
Lines changed: 32 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
597 | 597 |
| |
598 | 598 |
| |
599 | 599 |
| |
| 600 | + | |
| 601 | + | |
600 | 602 |
| |
601 | 603 |
| |
602 | 604 |
| |
| |||
644 | 646 |
| |
645 | 647 |
| |
646 | 648 |
| |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
647 | 678 |
| |
648 | 679 |
| |
649 | 680 |
| |
|
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
424 | 424 |
| |
425 | 425 |
| |
426 | 426 |
| |
427 |
| - | |
428 |
| - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
429 | 430 |
| |
430 | 431 |
| |
431 | 432 |
| |
| |||
434 | 435 |
| |
435 | 436 |
| |
436 | 437 |
| |
437 |
| - | |
438 |
| - | |
| 438 | + | |
| 439 | + | |
439 | 440 |
| |
440 | 441 |
| |
441 | 442 |
| |
|
Lines changed: 9 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
58 |
| - | |
| 58 | + | |
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
79 |
| - | |
| 79 | + | |
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
| 231 | + | |
232 | 232 |
| |
233 | 233 |
| |
234 | 234 |
| |
| |||
326 | 326 |
| |
327 | 327 |
| |
328 | 328 |
| |
329 |
| - | |
330 |
| - | |
331 |
| - | |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
339 | 329 |
| |
340 | 330 |
| |
341 | 331 |
| |
| |||
367 | 357 |
| |
368 | 358 |
| |
369 | 359 |
| |
370 |
| - | |
| 360 | + | |
371 | 361 |
| |
372 | 362 |
| |
373 | 363 |
| |
| |||
1066 | 1056 |
| |
1067 | 1057 |
| |
1068 | 1058 |
| |
1069 |
| - | |
| 1059 | + | |
1070 | 1060 |
| |
1071 | 1061 |
| |
1072 | 1062 |
| |
| |||
1155 | 1145 |
| |
1156 | 1146 |
| |
1157 | 1147 |
| |
1158 |
| - | |
1159 |
| - | |
1160 |
| - | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1161 | 1151 |
| |
1162 | 1152 |
| |
1163 | 1153 |
| |
|
0 commit comments
Comments
(0)