- Notifications
You must be signed in to change notification settings - Fork28
Commit293e24e
committed
Cache hash index's metapage in rel->rd_amcache.
This avoids a very significant amount of buffer manager traffic andcontention when scanning hash indexes, because it's no longernecessary to lock and pin the metapage for every scan. We do needsome way of figuring out when the cache is too stale to use any more,so that when we lock the primary bucket page to which the cachedmetapage points us, we can tell whether a split has occurred since wecached the metapage data. To do that, we use the hash_prevblkno fieldin the primary bucket page, which would otherwise always be set toInvalidBuffer.This patch contains code so that it will continue working (althoughless efficiently) with hash indexes built before this change, butperhaps we should consider bumping the hash version and ripping outthe compatibility code. That decision can be made later, though.Mithun Cy, reviewed by Jesper Pedersen, Amit Kapila, and by me.Before committing, I made a number of cosmetic changes to the lastposted version of the patch, adjusted _hash_getcachedmetap to be morecareful about order of operation, and made some necessary updates tothe pageinspect documentation and regression tests.1 parent39c3ca5 commit293e24e
File tree
8 files changed
+279
-181
lines changed- contrib/pageinspect/expected
- doc/src/sgml
- src
- backend/access/hash
- include/access
8 files changed
+279
-181
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
| 101 | + | |
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 |
| - | |
| 114 | + | |
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
| |||
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
140 |
| - | |
| 140 | + | |
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
539 | 539 |
| |
540 | 540 |
| |
541 | 541 |
| |
542 |
| - | |
| 542 | + | |
543 | 543 |
| |
544 | 544 |
| |
545 | 545 |
| |
|
Lines changed: 46 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
152 | 196 |
| |
153 | 197 |
| |
154 | 198 |
| |
| |||
188 | 232 |
| |
189 | 233 |
| |
190 | 234 |
| |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
201 |
| - | |
| 235 | + | |
202 | 236 |
| |
203 | 237 |
| |
204 | 238 |
| |
| |||
238 | 272 |
| |
239 | 273 |
| |
240 | 274 |
| |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
| 275 | + | |
252 | 276 |
| |
253 | 277 |
| |
254 | 278 |
| |
|
Lines changed: 33 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
510 |
| - | |
| 510 | + | |
511 | 511 |
| |
512 |
| - | |
| 512 | + | |
513 | 513 |
| |
514 | 514 |
| |
515 | 515 |
| |
516 | 516 |
| |
517 | 517 |
| |
518 |
| - | |
519 |
| - | |
520 |
| - | |
521 |
| - | |
522 |
| - | |
523 |
| - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
524 | 522 |
| |
525 |
| - | |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
532 | 528 |
| |
533 | 529 |
| |
534 | 530 |
| |
| |||
546 | 542 |
| |
547 | 543 |
| |
548 | 544 |
| |
549 |
| - | |
| 545 | + | |
550 | 546 |
| |
551 | 547 |
| |
552 | 548 |
| |
| |||
577 | 573 |
| |
578 | 574 |
| |
579 | 575 |
| |
580 |
| - | |
581 |
| - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
582 | 582 |
| |
583 |
| - | |
584 |
| - | |
585 |
| - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
586 | 589 |
| |
587 | 590 |
| |
588 | 591 |
| |
589 | 592 |
| |
590 | 593 |
| |
591 |
| - | |
592 |
| - | |
593 |
| - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
594 | 597 |
| |
595 | 598 |
| |
596 | 599 |
| |
| |||
600 | 603 |
| |
601 | 604 |
| |
602 | 605 |
| |
| 606 | + | |
| 607 | + | |
| 608 | + | |
603 | 609 |
| |
604 | 610 |
| |
605 | 611 |
| |
606 | 612 |
| |
607 | 613 |
| |
608 | 614 |
| |
609 | 615 |
| |
610 |
| - | |
611 |
| - | |
612 | 616 |
| |
| 617 | + | |
| 618 | + | |
| 619 | + | |
613 | 620 |
| |
614 | 621 |
| |
615 | 622 |
| |
|
Lines changed: 18 additions & 65 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
| 35 | + | |
38 | 36 |
| |
39 | 37 |
| |
40 | 38 |
| |
41 | 39 |
| |
42 | 40 |
| |
43 | 41 |
| |
44 | 42 |
| |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 | 43 |
| |
49 | 44 |
| |
50 | 45 |
| |
| |||
57 | 52 |
| |
58 | 53 |
| |
59 | 54 |
| |
60 |
| - | |
61 |
| - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
62 | 62 |
| |
63 |
| - | |
64 | 63 |
| |
65 | 64 |
| |
66 | 65 |
| |
| |||
76 | 75 |
| |
77 | 76 |
| |
78 | 77 |
| |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
132 | 82 |
| |
133 | 83 |
| |
134 | 84 |
| |
135 | 85 |
| |
136 | 86 |
| |
137 | 87 |
| |
138 |
| - | |
| 88 | + | |
139 | 89 |
| |
140 | 90 |
| |
141 | 91 |
| |
| |||
151 | 101 |
| |
152 | 102 |
| |
153 | 103 |
| |
154 |
| - | |
155 |
| - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
156 | 108 |
| |
157 | 109 |
| |
158 | 110 |
| |
| |||
225 | 177 |
| |
226 | 178 |
| |
227 | 179 |
| |
| 180 | + | |
228 | 181 |
| |
229 | 182 |
| |
230 | 183 |
| |
|
0 commit comments
Comments
(0)