forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit872770f
committed
Add VACUUM instrumentation for scanned pages, relfrozenxid.
Report on scanned pages within VACUUM VERBOSE and autovacuum logging.These are pages that were physically examined during the VACUUMoperation. Note that this can include a small number of pages that weremarked all-visible in the visibility map by some earlier VACUUMoperation. VACUUM won't skip all-visible pages that aren't part of arange of all-visible pages that's at least 32 blocks in length (partlyto avoid missing out on opportunities to advance relfrozenxid duringnon-aggressive VACUUMs).Commit44fa848 simplified the definition of scanned pages. It becamethe complement of the pages (of those pages from rel_pages) that wereskipped using the visibility map. And so scanned pages preciselyindicates how effective the visibility map was at saving work. (Beforenow we displayed the number of pages skipped via the visibility map whenhappened to be frozen pages, but not when they were merely all-visible,which was less useful to users.)Rename the user-visible OldestXmin output field to "removal cutoff", andshow some supplementary information: how far behind the cutoff is(number of XIDs behind) by the time the VACUUM operation finished. Thiswill help users to figure out what's _not_ working in extreme caseswhere VACUUM is fundamentally unable to remove dead tuples or freezeolder tuples (e.g., due to a leaked replication slot). Also report whenrelfrozenxid is advanced by VACUUM in output that immediately follows"removal cutoff". This structure is intended to highlight therelationship between the new relfrozenxid value for the table, and theVACUUM operation's removal cutoff.Finally, add instrumentation of "missed dead tuples", and the number ofpages that had at least one such tuple. These are fully DEAD (not justRECENTLY_DEAD) tuples with storage that could not be pruned due tofailure to acquire a cleanup lock on a heap page. This is a replacementfor the "skipped due to pin" instrumentation removed by commit44fa848.It shows more details than before for pages where failing to get acleanup lock actually resulted in VACUUM missing out on useful work, butusually shows nothing at all instead (the mere fact that we couldn't geta cleanup lock is usually of no consequence whatsoever now).Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/CAH2-Wznp=c=Opj8Z7RMR3G=ec3_JfGYMN_YvmCEjoPCHzWbx0g@mail.gmail.com1 parent80901b3 commit872770f
File tree
4 files changed
+82
-29
lines changed- src
- backend
- access/heap
- commands
- include/commands
4 files changed
+82
-29
lines changedLines changed: 68 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
| 202 | + | |
202 | 203 |
| |
203 | 204 |
| |
204 | 205 |
| |
| |||
212 | 213 |
| |
213 | 214 |
| |
214 | 215 |
| |
215 |
| - | |
216 |
| - | |
| 216 | + | |
| 217 | + | |
217 | 218 |
| |
218 | 219 |
| |
219 | 220 |
| |
| |||
318 | 319 |
| |
319 | 320 |
| |
320 | 321 |
| |
| 322 | + | |
| 323 | + | |
321 | 324 |
| |
322 | 325 |
| |
323 | 326 |
| |
| |||
539 | 542 |
| |
540 | 543 |
| |
541 | 544 |
| |
| 545 | + | |
542 | 546 |
| |
543 | 547 |
| |
544 |
| - | |
| 548 | + | |
| 549 | + | |
545 | 550 |
| |
546 | 551 |
| |
547 | 552 |
| |
548 | 553 |
| |
549 | 554 |
| |
550 | 555 |
| |
551 | 556 |
| |
552 |
| - | |
| 557 | + | |
| 558 | + | |
553 | 559 |
| |
554 | 560 |
| |
555 | 561 |
| |
| |||
565 | 571 |
| |
566 | 572 |
| |
567 | 573 |
| |
568 |
| - | |
| 574 | + | |
| 575 | + | |
569 | 576 |
| |
570 | 577 |
| |
571 | 578 |
| |
| |||
578 | 585 |
| |
579 | 586 |
| |
580 | 587 |
| |
| 588 | + | |
581 | 589 |
| |
582 | 590 |
| |
583 | 591 |
| |
| |||
629 | 637 |
| |
630 | 638 |
| |
631 | 639 |
| |
632 |
| - | |
| 640 | + | |
633 | 641 |
| |
634 | 642 |
| |
635 |
| - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
636 | 646 |
| |
637 |
| - | |
| 647 | + | |
638 | 648 |
| |
639 | 649 |
| |
640 |
| - | |
641 |
| - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
642 | 674 |
| |
643 | 675 |
| |
644 | 676 |
| |
| |||
779 | 811 |
| |
780 | 812 |
| |
781 | 813 |
| |
| 814 | + | |
782 | 815 |
| |
783 | 816 |
| |
784 | 817 |
| |
785 | 818 |
| |
786 | 819 |
| |
787 | 820 |
| |
788 |
| - | |
| 821 | + | |
| 822 | + | |
789 | 823 |
| |
790 | 824 |
| |
791 | 825 |
| |
| |||
1331 | 1365 |
| |
1332 | 1366 |
| |
1333 | 1367 |
| |
1334 |
| - | |
| 1368 | + | |
| 1369 | + | |
1335 | 1370 |
| |
1336 | 1371 |
| |
1337 | 1372 |
| |
| |||
1539 | 1574 |
| |
1540 | 1575 |
| |
1541 | 1576 |
| |
1542 |
| - | |
| 1577 | + | |
1543 | 1578 |
| |
1544 | 1579 |
| |
1545 | 1580 |
| |
| |||
1556 | 1591 |
| |
1557 | 1592 |
| |
1558 | 1593 |
| |
1559 |
| - | |
| 1594 | + | |
1560 | 1595 |
| |
1561 | 1596 |
| |
1562 | 1597 |
| |
| |||
1715 | 1750 |
| |
1716 | 1751 |
| |
1717 | 1752 |
| |
1718 |
| - | |
1719 |
| - | |
| 1753 | + | |
| 1754 | + | |
1720 | 1755 |
| |
1721 | 1756 |
| |
1722 |
| - | |
| 1757 | + | |
1723 | 1758 |
| |
1724 | 1759 |
| |
1725 | 1760 |
| |
| |||
1895 | 1930 |
| |
1896 | 1931 |
| |
1897 | 1932 |
| |
1898 |
| - | |
| 1933 | + | |
1899 | 1934 |
| |
1900 | 1935 |
| |
1901 | 1936 |
| |
| |||
1932 | 1967 |
| |
1933 | 1968 |
| |
1934 | 1969 |
| |
1935 |
| - | |
| 1970 | + | |
| 1971 | + | |
1936 | 1972 |
| |
1937 | 1973 |
| |
1938 | 1974 |
| |
| |||
1944 | 1980 |
| |
1945 | 1981 |
| |
1946 | 1982 |
| |
1947 |
| - | |
| 1983 | + | |
| 1984 | + | |
1948 | 1985 |
| |
1949 | 1986 |
| |
1950 | 1987 |
| |
| |||
2018 | 2055 |
| |
2019 | 2056 |
| |
2020 | 2057 |
| |
2021 |
| - | |
2022 |
| - | |
2023 | 2058 |
| |
| 2059 | + | |
2024 | 2060 |
| |
2025 | 2061 |
| |
2026 | 2062 |
| |
2027 | 2063 |
| |
2028 |
| - | |
| 2064 | + | |
2029 | 2065 |
| |
2030 |
| - | |
| 2066 | + | |
2031 | 2067 |
| |
2032 | 2068 |
| |
2033 | 2069 |
| |
| |||
2063 | 2099 |
| |
2064 | 2100 |
| |
2065 | 2101 |
| |
2066 |
| - | |
| 2102 | + | |
2067 | 2103 |
| |
2068 | 2104 |
| |
2069 | 2105 |
| |
| |||
2112 | 2148 |
| |
2113 | 2149 |
| |
2114 | 2150 |
| |
2115 |
| - | |
| 2151 | + | |
| 2152 | + | |
2116 | 2153 |
| |
2117 | 2154 |
| |
| 2155 | + | |
| 2156 | + | |
2118 | 2157 |
| |
2119 | 2158 |
| |
2120 | 2159 |
| |
| |||
2193 | 2232 |
| |
2194 | 2233 |
| |
2195 | 2234 |
| |
2196 |
| - | |
2197 |
| - | |
| 2235 | + | |
| 2236 | + | |
2198 | 2237 |
| |
2199 | 2238 |
| |
2200 | 2239 |
| |
| |||
3321 | 3360 |
| |
3322 | 3361 |
| |
3323 | 3362 |
| |
3324 |
| - | |
| 3363 | + | |
3325 | 3364 |
| |
3326 | 3365 |
| |
3327 | 3366 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
645 | 645 |
| |
646 | 646 |
| |
647 | 647 |
| |
| 648 | + | |
648 | 649 |
| |
649 | 650 |
| |
650 | 651 |
| |
| |||
661 | 662 |
| |
662 | 663 |
| |
663 | 664 |
| |
| 665 | + | |
664 | 666 |
| |
665 | 667 |
| |
666 | 668 |
| |
| |||
673 | 675 |
| |
674 | 676 |
| |
675 | 677 |
| |
| 678 | + | |
676 | 679 |
| |
677 | 680 |
| |
678 | 681 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1315 | 1315 |
| |
1316 | 1316 |
| |
1317 | 1317 |
| |
| 1318 | + | |
1318 | 1319 |
| |
1319 | 1320 |
| |
1320 | 1321 |
| |
| |||
1390 | 1391 |
| |
1391 | 1392 |
| |
1392 | 1393 |
| |
| 1394 | + | |
| 1395 | + | |
1393 | 1396 |
| |
1394 | 1397 |
| |
1395 | 1398 |
| |
1396 | 1399 |
| |
1397 | 1400 |
| |
1398 | 1401 |
| |
| 1402 | + | |
| 1403 | + | |
1399 | 1404 |
| |
1400 | 1405 |
| |
1401 | 1406 |
| |
1402 | 1407 |
| |
1403 | 1408 |
| |
| 1409 | + | |
| 1410 | + | |
1404 | 1411 |
| |
1405 | 1412 |
| |
1406 | 1413 |
| |
1407 | 1414 |
| |
1408 | 1415 |
| |
| 1416 | + | |
| 1417 | + | |
1409 | 1418 |
| |
1410 | 1419 |
| |
1411 | 1420 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
283 | 283 |
| |
284 | 284 |
| |
285 | 285 |
| |
| 286 | + | |
| 287 | + | |
286 | 288 |
| |
287 | 289 |
| |
288 | 290 |
| |
|
0 commit comments
Comments
(0)