- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9dc718b
committed
Pass down "logically unchanged index" hint.
Add an executor aminsert() hint mechanism that informs index AMs thatthe incoming index tuple (the tuple that accompanies the hint) is notbeing inserted by execution of an SQL statement that logically modifiesany of the index's key columns.The hint is received by indexes when an UPDATE takes place that does notapply an optimization like heapam's HOT (though only for indexes whereall key columns are logically unchanged). Any index tuple that receivesthe hint on insert is expected to be a duplicate of at least oneexisting older version that is needed for the same logical row. Relatedversions will typically be stored on the same index page, at leastwithin index AMs that apply the hint.Recognizing the difference between MVCC version churn duplicates andtrue logical row duplicates at the index AM level can help with cleanupof garbage index tuples. Cleanup can intelligently target tuples thatare likely to be garbage, without wasting too many cycles on lesspromising tuples/pages (index pages with little or no version churn).This is infrastructure for an upcoming commit that will teach nbtree toperform bottom-up index deletion. No index AM actually applies the hintjust yet.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Victor Yegorov <vyegorov@gmail.com>Discussion:https://postgr.es/m/CAH2-Wz=CEKFa74EScx_hFVshCOn6AA5T-ajFASTdzipdkLTNQQ@mail.gmail.com1 parent39b0369 commit9dc718b
File tree
31 files changed
+214
-25
lines changed- contrib/bloom
- doc/src/sgml
- src
- backend
- access
- brin
- common
- gin
- gist
- hash
- heap
- index
- nbtree
- spgist
- catalog
- commands
- executor
- replication/logical
- include
- access
- executor
- test/modules/dummy_index_am
31 files changed
+214
-25
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| 201 | + | |
201 | 202 |
| |
202 | 203 |
| |
203 | 204 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
192 | 192 |
| |
193 | 193 |
| |
194 | 194 |
| |
| 195 | + | |
195 | 196 |
| |
196 | 197 |
| |
197 | 198 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
293 | 293 |
| |
294 | 294 |
| |
295 | 295 |
| |
| 296 | + | |
296 | 297 |
| |
297 | 298 |
| |
298 | 299 |
| |
| |||
308 | 309 |
| |
309 | 310 |
| |
310 | 311 |
| |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
311 | 326 |
| |
312 | 327 |
| |
313 | 328 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
| 154 | + | |
154 | 155 |
| |
155 | 156 |
| |
156 | 157 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
331 |
| - | |
| 331 | + | |
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
488 | 488 |
| |
489 | 489 |
| |
490 | 490 |
| |
| 491 | + | |
491 | 492 |
| |
492 | 493 |
| |
493 | 494 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
| 159 | + | |
159 | 160 |
| |
160 | 161 |
| |
161 | 162 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
| 250 | + | |
250 | 251 |
| |
251 | 252 |
| |
252 | 253 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1956 | 1956 |
| |
1957 | 1957 |
| |
1958 | 1958 |
| |
| 1959 | + | |
1959 | 1960 |
| |
1960 | 1961 |
| |
1961 | 1962 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
| 182 | + | |
182 | 183 |
| |
183 | 184 |
| |
184 | 185 |
| |
| |||
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
194 |
| - | |
| 195 | + | |
| 196 | + | |
195 | 197 |
| |
196 | 198 |
| |
197 | 199 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
| 202 | + | |
202 | 203 |
| |
203 | 204 |
| |
204 | 205 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
| 210 | + | |
210 | 211 |
| |
211 | 212 |
| |
212 | 213 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
| 165 | + | |
165 | 166 |
| |
166 | 167 |
| |
167 | 168 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
178 |
| - | |
| 178 | + | |
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
342 | 342 |
| |
343 | 343 |
| |
344 | 344 |
| |
345 |
| - | |
346 |
| - | |
| 345 | + | |
| 346 | + | |
347 | 347 |
| |
348 | 348 |
| |
349 | 349 |
| |
| |||
1087 | 1087 |
| |
1088 | 1088 |
| |
1089 | 1089 |
| |
| 1090 | + | |
1090 | 1091 |
| |
1091 | 1092 |
| |
1092 | 1093 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
| 74 | + | |
| 75 | + | |
78 | 76 |
| |
79 | 77 |
| |
80 | 78 |
| |
|
Lines changed: 156 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 |
| |
128 | 137 |
| |
129 | 138 |
| |
| |||
136 | 145 |
| |
137 | 146 |
| |
138 | 147 |
| |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
139 | 153 |
| |
140 | 154 |
| |
141 | 155 |
| |
| |||
254 | 268 |
| |
255 | 269 |
| |
256 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
257 | 281 |
| |
258 | 282 |
| |
259 | 283 |
| |
| |||
263 | 287 |
| |
264 | 288 |
| |
265 | 289 |
| |
266 |
| - | |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 | 290 |
| |
271 | 291 |
| |
272 | 292 |
| |
273 | 293 |
| |
274 | 294 |
| |
275 | 295 |
| |
| 296 | + | |
276 | 297 |
| |
277 | 298 |
| |
278 | 299 |
| |
| |||
319 | 340 |
| |
320 | 341 |
| |
321 | 342 |
| |
| 343 | + | |
322 | 344 |
| |
323 | 345 |
| |
324 | 346 |
| |
| |||
389 | 411 |
| |
390 | 412 |
| |
391 | 413 |
| |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
392 | 424 |
| |
393 | 425 |
| |
394 | 426 |
| |
395 | 427 |
| |
396 | 428 |
| |
397 | 429 |
| |
398 | 430 |
| |
| 431 | + | |
399 | 432 |
| |
400 | 433 |
| |
401 | 434 |
| |
| |||
899 | 932 |
| |
900 | 933 |
| |
901 | 934 |
| |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + |
0 commit comments
Comments
(0)