forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitea69a0d
committed
Expand hash indexes more gradually.
Since hash indexes typically have very few overflow pages, adding anew splitpoint essentially doubles the on-disk size of the index,which can lead to large and abrupt increases in disk usage (andperhaps long delays on occasion). To mitigate this problem to somedegree, divide larger splitpoints into four equal phases. This meansthat, for example, instead of growing from 4GB to 8GB all at once, ahash index will now grow from 4GB to 5GB to 6GB to 7GB to 8GB, whichis perhaps still not as smooth as we'd like but certainly animprovement.This changes the on-disk format of the metapage, so bump HASH_VERSIONfrom 2 to 3. This will force a REINDEX of all existing hash indexes,but that's probably a good idea anyway. First, hash indexes frompre-10 versions of PostgreSQL could easily be corrupted, and we don'twant to confuse corruption carried over from an older release with anycorruption caused despite the new write-ahead logging in v10. Second,it will let us remove some backward-compatibility code added by commit293e24e.Mithun Cy, reviewed by Amit Kapila, Jesper Pedersen and me. Regressiontest outputs updated by me.Discussion:http://postgr.es/m/CAD__OuhG6F1gQLCgMQNnMNgoCvOLQZz9zKYJQNYvYmmJoM42gA@mail.gmail.comDiscussion:http://postgr.es/m/CA+TgmoYty0jCf-pa+m+vYUJ716+AxM7nv_syvyanyf5O-L_i2A@mail.gmail.com1 parent334bf9c commitea69a0d
File tree
11 files changed
+218
-86
lines changed- contrib
- pageinspect/expected
- pgstattuple/expected
- doc/src/sgml
- src
- backend
- access/hash
- utils/sort
- include
- access
- utils
11 files changed
+218
-86
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
134 | 134 |
| |
135 | 135 |
| |
136 | 136 |
| |
137 |
| - | |
| 137 | + | |
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| |||
235 | 235 |
| |
236 | 236 |
| |
237 | 237 |
| |
238 |
| - | |
| 238 | + | |
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
658 | 658 |
| |
659 | 659 |
| |
660 | 660 |
| |
661 |
| - | |
| 661 | + | |
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
| |||
667 | 667 |
| |
668 | 668 |
| |
669 | 669 |
| |
670 |
| - | |
| 670 | + | |
671 | 671 |
| |
672 | 672 |
| |
673 | 673 |
| |
674 |
| - | |
| 674 | + | |
675 | 675 |
| |
676 | 676 |
| |
677 | 677 |
| |
|
Lines changed: 39 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
80 | 96 |
| |
81 |
| - | |
82 |
| - | |
| 97 | + | |
| 98 | + | |
83 | 99 |
| |
84 | 100 |
| |
85 | 101 |
| |
86 | 102 |
| |
87 | 103 |
| |
88 | 104 |
| |
89 |
| - | |
| 105 | + | |
90 | 106 |
| |
91 | 107 |
| |
92 | 108 |
| |
| |||
101 | 117 |
| |
102 | 118 |
| |
103 | 119 |
| |
104 |
| - | |
| 120 | + | |
105 | 121 |
| |
106 | 122 |
| |
107 | 123 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
70 |
| - | |
| 70 | + | |
71 | 71 |
| |
72 |
| - | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
| 77 | + | |
| 78 | + | |
78 | 79 |
| |
79 | 80 |
| |
80 | 81 |
| |
|
Lines changed: 33 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
502 | 502 |
| |
503 | 503 |
| |
504 | 504 |
| |
505 |
| - | |
| 505 | + | |
506 | 506 |
| |
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
510 | 510 |
| |
511 |
| - | |
512 |
| - | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
513 | 514 |
| |
514 | 515 |
| |
515 | 516 |
| |
| |||
518 | 519 |
| |
519 | 520 |
| |
520 | 521 |
| |
521 |
| - | |
| 522 | + | |
522 | 523 |
| |
523 |
| - | |
524 |
| - | |
525 |
| - | |
| 524 | + | |
| 525 | + | |
526 | 526 |
| |
527 | 527 |
| |
528 | 528 |
| |
| |||
563 | 563 |
| |
564 | 564 |
| |
565 | 565 |
| |
566 |
| - | |
567 |
| - | |
| 566 | + | |
568 | 567 |
| |
569 |
| - | |
570 |
| - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
571 | 576 |
| |
572 | 577 |
| |
573 | 578 |
| |
574 | 579 |
| |
575 | 580 |
| |
576 |
| - | |
577 |
| - | |
| 581 | + | |
| 582 | + | |
578 | 583 |
| |
579 | 584 |
| |
580 | 585 |
| |
| |||
773 | 778 |
| |
774 | 779 |
| |
775 | 780 |
| |
776 |
| - | |
777 |
| - | |
| 781 | + | |
| 782 | + | |
778 | 783 |
| |
779 |
| - | |
| 784 | + | |
780 | 785 |
| |
781 | 786 |
| |
| 787 | + | |
| 788 | + | |
782 | 789 |
| |
783 | 790 |
| |
784 | 791 |
| |
785 |
| - | |
786 |
| - | |
787 |
| - | |
788 |
| - | |
789 |
| - | |
790 |
| - | |
791 |
| - | |
792 |
| - | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
793 | 797 |
| |
794 |
| - | |
| 798 | + | |
| 799 | + | |
795 | 800 |
| |
796 | 801 |
| |
797 | 802 |
| |
| |||
836 | 841 |
| |
837 | 842 |
| |
838 | 843 |
| |
839 |
| - | |
840 |
| - | |
841 |
| - | |
842 |
| - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
843 | 847 |
| |
844 | 848 |
| |
845 | 849 |
| |
|
Lines changed: 20 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 |
| |
42 | 50 |
| |
43 | 51 |
| |
| |||
56 | 64 |
| |
57 | 65 |
| |
58 | 66 |
| |
59 |
| - | |
60 |
| - | |
61 |
| - | |
| 67 | + | |
| 68 | + | |
62 | 69 |
| |
63 |
| - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
64 | 73 |
| |
65 | 74 |
| |
66 | 75 |
| |
| |||
69 | 78 |
| |
70 | 79 |
| |
71 | 80 |
| |
72 |
| - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 |
| |
74 | 85 |
| |
75 | 86 |
| |
| |||
122 | 133 |
| |
123 | 134 |
| |
124 | 135 |
| |
125 |
| - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
126 | 139 |
| |
127 | 140 |
| |
128 | 141 |
| |
|
0 commit comments
Comments
(0)