forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8c19977
committed
Avoid changing an index's indcheckxmin horizon during REINDEX.
There can never be a need to push the indcheckxmin horizon forward, sinceany HOT chains that are actually broken with respect to the index mustpre-date its original creation. So we can just avoid changing pg_indexaltogether during a REINDEX operation.This offers a cleaner solution than my previous patch for the problemfound a few days ago that we mustn't try to update pg_index while we arereindexing it. System catalog indexes will always be created withindcheckxmin = false during initdb, and with this modified code we shouldnever try to change their pg_index entries. This avoids special-casingsystem catalogs as the former patch did, and should provide a performancebenefit for many cases where REINDEX formerly caused an index to beconsidered unusable for a short time.Back-patch to 8.3 to cover all versions containing HOT. Note that thispatch changes the API for index_build(), but I believe it is unlikely thatany add-on code is calling that directly.1 parentc096d19 commit8c19977
File tree
6 files changed
+42
-11
lines changed- src
- backend
- bootstrap
- catalog
- commands
- include/catalog
6 files changed
+42
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2569 | 2569 | | |
2570 | 2570 | | |
2571 | 2571 | | |
2572 | | - | |
| 2572 | + | |
2573 | 2573 | | |
2574 | 2574 | | |
2575 | 2575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | | - | |
| 1064 | + | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
| |||
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | | - | |
1684 | | - | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
1685 | 1688 | | |
1686 | 1689 | | |
1687 | 1690 | | |
| |||
1691 | 1694 | | |
1692 | 1695 | | |
1693 | 1696 | | |
1694 | | - | |
| 1697 | + | |
| 1698 | + | |
1695 | 1699 | | |
1696 | 1700 | | |
1697 | 1701 | | |
| |||
1762 | 1766 | | |
1763 | 1767 | | |
1764 | 1768 | | |
1765 | | - | |
1766 | | - | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
1767 | 1778 | | |
1768 | 1779 | | |
1769 | 1780 | | |
| |||
1778 | 1789 | | |
1779 | 1790 | | |
1780 | 1791 | | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
1781 | 1795 | | |
1782 | 1796 | | |
1783 | 1797 | | |
| |||
2767 | 2781 | | |
2768 | 2782 | | |
2769 | 2783 | | |
2770 | | - | |
| 2784 | + | |
2771 | 2785 | | |
2772 | 2786 | | |
2773 | 2787 | | |
| |||
2787 | 2801 | | |
2788 | 2802 | | |
2789 | 2803 | | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
2790 | 2814 | | |
2791 | 2815 | | |
2792 | 2816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1401 | 1407 | | |
1402 | 1408 | | |
1403 | 1409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
0 commit comments
Comments
(0)