forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitebcbc8c
committed
Avoid changing an index's indcheckxmin horizon during REINDEX.
There can never be a need to push the indcheckxmin horizon forward, sinceany HOT chains that are actually broken with respect to the index mustpre-date its original creation. So we can just avoid changing pg_indexaltogether during a REINDEX operation.This offers a cleaner solution than my previous patch for the problemfound a few days ago that we mustn't try to update pg_index while we arereindexing it. System catalog indexes will always be created withindcheckxmin = false during initdb, and with this modified code we shouldnever try to change their pg_index entries. This avoids special-casingsystem catalogs as the former patch did, and should provide a performancebenefit for many cases where REINDEX formerly caused an index to beconsidered unusable for a short time.Back-patch to 8.3 to cover all versions containing HOT. Note that thispatch changes the API for index_build(), but I believe it is unlikely thatany add-on code is calling that directly.1 parent1da9966 commitebcbc8c
File tree
6 files changed
+42
-11
lines changed- src
- backend
- bootstrap
- catalog
- commands
- include/catalog
6 files changed
+42
-11
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1127 | 1127 |
| |
1128 | 1128 |
| |
1129 | 1129 |
| |
1130 |
| - | |
| 1130 | + | |
1131 | 1131 |
| |
1132 | 1132 |
| |
1133 | 1133 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2451 | 2451 |
| |
2452 | 2452 |
| |
2453 | 2453 |
| |
2454 |
| - | |
| 2454 | + | |
2455 | 2455 |
| |
2456 | 2456 |
| |
2457 | 2457 |
| |
|
Lines changed: 31 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
957 | 957 |
| |
958 | 958 |
| |
959 | 959 |
| |
960 |
| - | |
| 960 | + | |
961 | 961 |
| |
962 | 962 |
| |
963 | 963 |
| |
| |||
1389 | 1389 |
| |
1390 | 1390 |
| |
1391 | 1391 |
| |
1392 |
| - | |
1393 |
| - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
1394 | 1397 |
| |
1395 | 1398 |
| |
1396 | 1399 |
| |
| |||
1400 | 1403 |
| |
1401 | 1404 |
| |
1402 | 1405 |
| |
1403 |
| - | |
| 1406 | + | |
| 1407 | + | |
1404 | 1408 |
| |
1405 | 1409 |
| |
1406 | 1410 |
| |
| |||
1454 | 1458 |
| |
1455 | 1459 |
| |
1456 | 1460 |
| |
1457 |
| - | |
1458 |
| - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
1459 | 1470 |
| |
1460 | 1471 |
| |
1461 | 1472 |
| |
| |||
1470 | 1481 |
| |
1471 | 1482 |
| |
1472 | 1483 |
| |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1473 | 1487 |
| |
1474 | 1488 |
| |
1475 | 1489 |
| |
| |||
2461 | 2475 |
| |
2462 | 2476 |
| |
2463 | 2477 |
| |
2464 |
| - | |
| 2478 | + | |
2465 | 2479 |
| |
2466 | 2480 |
| |
2467 | 2481 |
| |
| |||
2481 | 2495 |
| |
2482 | 2496 |
| |
2483 | 2497 |
| |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
2484 | 2508 |
| |
2485 | 2509 |
| |
2486 | 2510 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1360 | 1360 |
| |
1361 | 1361 |
| |
1362 | 1362 |
| |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1363 | 1369 |
| |
1364 | 1370 |
| |
1365 | 1371 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
584 | 584 |
| |
585 | 585 |
| |
586 | 586 |
| |
587 |
| - | |
| 587 | + | |
588 | 588 |
| |
589 | 589 |
| |
590 | 590 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
62 |
| - | |
| 62 | + | |
| 63 | + | |
63 | 64 |
| |
64 | 65 |
| |
65 | 66 |
| |
|
0 commit comments
Comments
(0)