forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb1328d7
committed
Invent PageIndexTupleOverwrite, and teach BRIN and GiST to use it.
PageIndexTupleOverwrite performs approximately the same function asPageIndexTupleDelete (or PageIndexDeleteNoCompact) followed by PageAddItemtargeting the same item pointer offset. But in the case where the newtuple is the same size as the old, it avoids shuffling other data around onthe page, because the new tuple is placed where the old one was rather thanbeing appended to the end of the page. This has been shown to provide asubstantial speedup for some GiST use-cases.Also, this change allows some API simplifications: we can get rid ofthe rather klugy and error-prone PAI_ALLOW_FAR_OFFSET flag forPageAddItemExtended, since that was used only to cover a corner casefor BRIN that's better expressed by using PageIndexTupleOverwrite.Note that this patch causes a rather subtle WAL incompatibility: thephysical page content change represented by certain WAL records is nowdifferent than it was before, because while the tuples have the sameitempointer line numbers, the tuples themselves are in different places.I have not bumped the WAL version number because I think it doesn't matterunless you are trying to do bitwise comparisons of original and replayedpages, and in any case we're early in a devel cycle and there will probablybe more WAL changes before v10 gets out the door.There is probably room to make use of PageIndexTupleOverwrite in SP-GiSTand GIN too, but that is left for a future patch.Andrey Borodin, reviewed by Anastasia Lubennikova, whacked around a bitby meDiscussion: <CAJEAwVGQjGGOj6mMSgMwGvtFd5Kwe6VFAxY=uEPZWMDjzbn4VQ@mail.gmail.com>1 parent5c609a7 commitb1328d7
File tree
6 files changed
+179
-40
lines changed- src
- backend
- access
- brin
- gist
- storage/page
- include/storage
6 files changed
+179
-40
lines changedLines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 |
| - | |
| 181 | + | |
| 182 | + | |
185 | 183 |
| |
186 | 184 |
| |
187 | 185 |
| |
|
Lines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
192 |
| - | |
193 |
| - | |
194 | 192 |
| |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 |
| - | |
| 193 | + | |
| 194 | + | |
200 | 195 |
| |
201 | 196 |
| |
202 | 197 |
| |
|
Lines changed: 24 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
493 | 493 |
| |
494 | 494 |
| |
495 | 495 |
| |
496 |
| - | |
| 496 | + | |
497 | 497 |
| |
498 | 498 |
| |
499 | 499 |
| |
500 | 500 |
| |
501 |
| - | |
502 |
| - | |
503 |
| - | |
| 501 | + | |
| 502 | + | |
504 | 503 |
| |
505 | 504 |
| |
506 |
| - | |
507 |
| - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
508 | 526 |
| |
509 | 527 |
| |
510 | 528 |
| |
|
Lines changed: 26 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
83 |
| - | |
84 |
| - | |
| 83 | + | |
85 | 84 |
| |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
86 | 108 |
| |
87 | 109 |
| |
88 | 110 |
| |
| |||
92 | 114 |
| |
93 | 115 |
| |
94 | 116 |
| |
95 |
| - | |
| 117 | + | |
96 | 118 |
| |
97 | 119 |
| |
98 | 120 |
| |
| |||
115 | 137 |
| |
116 | 138 |
| |
117 | 139 |
| |
| 140 | + | |
118 | 141 |
| |
119 | 142 |
| |
120 | 143 |
| |
|
Lines changed: 123 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 |
| |
177 | 183 |
| |
178 | 184 |
| |
179 | 185 |
| |
180 | 186 |
| |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 | 187 |
| |
185 | 188 |
| |
186 | 189 |
| |
| |||
267 | 270 |
| |
268 | 271 |
| |
269 | 272 |
| |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
| 273 | + | |
| 274 | + | |
275 | 275 |
| |
276 | 276 |
| |
277 | 277 |
| |
| |||
290 | 290 |
| |
291 | 291 |
| |
292 | 292 |
| |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
| 293 | + | |
297 | 294 |
| |
298 | 295 |
| |
299 | 296 |
| |
| |||
1093 | 1090 |
| |
1094 | 1091 |
| |
1095 | 1092 |
| |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1096 | 1200 |
| |
1097 | 1201 |
| |
1098 | 1202 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
409 | 409 |
| |
410 | 410 |
| |
411 | 411 |
| |
412 |
| - | |
413 | 412 |
| |
414 | 413 |
| |
415 | 414 |
| |
| |||
429 | 428 |
| |
430 | 429 |
| |
431 | 430 |
| |
| 431 | + | |
| 432 | + | |
432 | 433 |
| |
433 | 434 |
| |
434 | 435 |
| |
|
0 commit comments
Comments
(0)