forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdd94c28
committed
Fix "single value strategy" index deletion issue.
It is not appropriate for deduplication to apply single value strategywhen triggered by a bottom-up index deletion pass. This wastes cyclesbecause later bottom-up deletion passes will overinterpret olderduplicate tuples that deduplication actually just skipped over "bydesign". It also makes bottom-up deletion much less effective for lowcardinality indexes that happen to cross a meaningless "index has singlekey value per leaf page" threshold.To fix, slightly narrow the conditions under which deduplication'ssingle value strategy is considered. We already avoided the strategyfor a unique index, since our high level goal must just be to buy timefor VACUUM to run (not to buy space). We'll now also avoid it when wejust had a bottom-up pass that reported failure. The two cases sharethe same high level goal, and already overlapped significantly, so thisapproach is quite natural.Oversight in commitd168b66, which added bottom-up index deletion.Author: Peter Geoghegan <pg@bowt.ie>Discussion:https://postgr.es/m/CAH2-WznaOvM+Gyj-JQ0X=JxoMDxctDTYjiEuETdAGbF5EUc3MA@mail.gmail.comBackpatch: 14-, where bottom-up deletion was introduced.1 parent1a9d802 commitdd94c28
File tree
3 files changed
+19
-21
lines changed- src
- backend/access/nbtree
- include/access
3 files changed
+19
-21
lines changedLines changed: 17 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 |
| |
46 | 49 |
| |
47 | 50 |
| |
| |||
52 | 55 |
| |
53 | 56 |
| |
54 | 57 |
| |
55 |
| - | |
| 58 | + | |
56 | 59 |
| |
57 | 60 |
| |
58 | 61 |
| |
| |||
97 | 100 |
| |
98 | 101 |
| |
99 | 102 |
| |
100 |
| - | |
101 |
| - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
102 | 108 |
| |
103 | 109 |
| |
104 | 110 |
| |
| |||
764 | 770 |
| |
765 | 771 |
| |
766 | 772 |
| |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
771 |
| - | |
772 |
| - | |
773 |
| - | |
774 |
| - | |
775 | 773 |
| |
776 | 774 |
| |
777 | 775 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2748 | 2748 |
| |
2749 | 2749 |
| |
2750 | 2750 |
| |
2751 |
| - | |
| 2751 | + | |
2752 | 2752 |
| |
2753 | 2753 |
| |
2754 | 2754 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1155 | 1155 |
| |
1156 | 1156 |
| |
1157 | 1157 |
| |
1158 |
| - | |
| 1158 | + | |
1159 | 1159 |
| |
1160 | 1160 |
| |
1161 | 1161 |
| |
|
0 commit comments
Comments
(0)