forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit620b49a
committed
hash: Increase the number of possible overflow bitmaps by 8x.
Per a report from AP, it's not that hard to exhaust the supply ofbitmap pages if you create a table with a hash index and then insert afew billion rows - and then you start getting errors when you try toinsert additional rows. In the particular case reported by AP,there's another fix that we can make to improve recycling of overflowpages, which is another way to avoid the error, but there may be othercases where this problem happens and that fix won't help. So let'sbuy ourselves as much headroom as we can without rearchitectinganything.The comments claim that the old limit was 64GB, but it was reallyonly 32GB, because we didn't use all the bits in the page for bitmapbits - only the largest power of 2 that could fit after deductingspace for the page header and so forth. Thus, we have 4kB per pagefor bitmap bits, not 8kB. The new limit is thus actually 8 times theold *real* limit but only 4 times the old *purported* limit.Since this breaks on-disk compatibility, bump HASH_VERSION. We'vealready done this earlier in this release cycle, so this doesn't causeany incremental inconvenience for people using pg_upgrade fromreleases prior to v10. However, users who use pg_upgrade to reach10beta3 or later from 10beta2 or earlier will need to REINDEX any hashindexes again.Amit Kapila and Robert HaasDiscussion:http://postgr.es/m/20170704105728.mwb72jebfmok2nm2@zip.com.au1 parentc30f177 commit620b49a
File tree
5 files changed
+19
-15
lines changed- contrib
- pageinspect/expected
- pgstattuple/expected
- doc/src/sgml
- src/include/access
5 files changed
+19
-15
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
| 46 | + | |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
| 61 | + | |
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
|
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: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
687 | 687 |
| |
688 | 688 |
| |
689 | 689 |
| |
690 |
| - | |
691 |
| - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
692 | 697 |
| |
693 | 698 |
| |
694 | 699 |
| |
| |||
703 | 708 |
| |
704 | 709 |
| |
705 | 710 |
| |
706 |
| - | |
707 |
| - | |
| 711 | + | |
| 712 | + | |
708 | 713 |
| |
709 | 714 |
| |
710 | 715 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
368 | 368 |
| |
369 | 369 |
| |
370 | 370 |
| |
371 |
| - | |
| 371 | + | |
372 | 372 |
| |
373 | 373 |
| |
374 | 374 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
158 | 158 |
| |
159 | 159 |
| |
160 | 160 |
| |
161 |
| - | |
162 |
| - | |
| 161 | + | |
163 | 162 |
| |
164 | 163 |
| |
165 | 164 |
| |
| |||
182 | 181 |
| |
183 | 182 |
| |
184 | 183 |
| |
185 |
| - | |
186 |
| - | |
| 184 | + | |
| 185 | + | |
187 | 186 |
| |
188 |
| - | |
| 187 | + | |
189 | 188 |
| |
190 | 189 |
| |
191 | 190 |
| |
|
0 commit comments
Comments
(0)