forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit41d2c6f
committed
Add missing index_insert_cleanup calls
The optimization for inserts into BRIN indexes added byc1ec02brelies on a cache that needs to be explicitly released after callingindex_insert(). The commit however failed to invoke the cleanup invalidate_index(), which calls index_insert() indirectly throughtable_index_validate_scan().After inspecting index_insert() callers, it seems unique_key_recheck()is missing the call too.Fixed by adding the two missing index_insert_cleanup() calls.The commit does two additional improvements. The aminsertcleanup()signature is modified to have the index as the first argument, to makeit more like the other AM callbacks. And the aminsertcleanup() callbackis invoked even if the ii_AmCache is NULL, so that it can decide if thecleanup is necessary.Author: Alvaro Herrera, Tomas VondraReported-by: Alexander LakhinDiscussion:https://postgr.es/m/202401091043.e3nrqiad6gb7@alvherre.pgsql1 parent95d14b7 commit41d2c6f
File tree
9 files changed
+26
-16
lines changed- doc/src/sgml
- src
- backend
- access
- brin
- index
- catalog
- commands
- include/access
- test/regress
- expected
- sql
9 files changed
+26
-16
lines changedLines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
374 | 373 |
| |
375 | 374 |
| |
376 | 375 |
| |
377 | 376 |
| |
378 | 377 |
| |
379 |
| - | |
| 378 | + | |
| 379 | + | |
380 | 380 |
| |
381 | 381 |
| |
382 | 382 |
| |
383 |
| - | |
384 |
| - | |
| 383 | + | |
| 384 | + | |
385 | 385 |
| |
386 | 386 |
| |
387 | 387 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
500 | 500 |
| |
501 | 501 |
| |
502 | 502 |
| |
503 |
| - | |
| 503 | + | |
504 | 504 |
| |
505 | 505 |
| |
506 | 506 |
| |
507 |
| - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
508 | 510 |
| |
509 | 511 |
| |
510 | 512 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
246 | 245 |
| |
247 |
| - | |
248 |
| - | |
| 246 | + | |
| 247 | + | |
249 | 248 |
| |
250 | 249 |
| |
251 | 250 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3402 | 3402 |
| |
3403 | 3403 |
| |
3404 | 3404 |
| |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
3405 | 3408 |
| |
3406 | 3409 |
| |
3407 | 3410 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
| 177 | + | |
| 178 | + | |
| 179 | + | |
177 | 180 |
| |
178 | 181 |
| |
179 | 182 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
| 118 | + | |
118 | 119 |
| |
119 | 120 |
| |
120 | 121 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
99 |
| - | |
| 99 | + | |
100 | 100 |
| |
101 | 101 |
| |
102 | 102 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
575 | 575 |
| |
576 | 576 |
| |
577 | 577 |
| |
578 |
| - | |
| 578 | + | |
579 | 579 |
| |
| 580 | + | |
580 | 581 |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
519 | 519 |
| |
520 | 520 |
| |
521 | 521 |
| |
522 |
| - | |
| 522 | + | |
523 | 523 |
| |
| 524 | + | |
524 | 525 |
|
0 commit comments
Comments
(0)