forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit27f5c71
committed
Fix CREATE INDEX progress reporting for multi-level partitioning.
The "partitions_total" and "partitions_done" fields were updatedas though the current level of partitioning was the only one.In multi-level cases, not only could partitions_total changeover the course of the command, but partitions_done could gobackwards or exceed the currently-reported partitions_total.Fix by setting partitions_total to the total number of directand indirect children once at command start, and then justincrementing partitions_done at appropriate points. Inventa new progress monitoring function "pgstat_progress_incr_param"to simplify doing the latter. We can avoid adding cost for theformer when doing CREATE INDEX, because ProcessUtility alreadyenumerates the children and it's pretty easy to pass the countdown to DefineIndex. In principle the same could be done inALTER TABLE, but that's structurally difficult; for now, justeat the cost of an extra find_all_inheritors scan in that case.Ilya Gladyshev and Justin PryzbyDiscussion:https://postgr.es/m/a15f904a70924ffa4ca25c3c744cff31e0e6e143.camel@gmail.com1 parent81a6d57 commit27f5c71
File tree
8 files changed
+106
-15
lines changed- doc/src/sgml
- src
- backend
- bootstrap
- commands
- tcop
- utils/activity
- include
- commands
- utils
8 files changed
+106
-15
lines changedLines changed: 10 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6817 | 6817 |
| |
6818 | 6818 |
| |
6819 | 6819 |
| |
6820 |
| - | |
| 6820 | + | |
6821 | 6821 |
| |
6822 | 6822 |
| |
6823 | 6823 |
| |
| |||
6863 | 6863 |
| |
6864 | 6864 |
| |
6865 | 6865 |
| |
6866 |
| - | |
| 6866 | + | |
6867 | 6867 |
| |
6868 | 6868 |
| |
6869 | 6869 |
| |
| |||
6946 | 6946 |
| |
6947 | 6947 |
| |
6948 | 6948 |
| |
6949 |
| - | |
6950 |
| - | |
6951 |
| - | |
| 6949 | + | |
| 6950 | + | |
| 6951 | + | |
| 6952 | + | |
6952 | 6953 |
| |
6953 | 6954 |
| |
6954 | 6955 |
| |
| |||
6957 | 6958 |
| |
6958 | 6959 |
| |
6959 | 6960 |
| |
6960 |
| - | |
6961 |
| - | |
6962 |
| - | |
| 6961 | + | |
| 6962 | + | |
| 6963 | + | |
| 6964 | + | |
6963 | 6965 |
| |
6964 | 6966 |
| |
6965 | 6967 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
306 | 306 |
| |
307 | 307 |
| |
308 | 308 |
| |
| 309 | + | |
309 | 310 |
| |
310 | 311 |
| |
311 | 312 |
| |
| |||
358 | 359 |
| |
359 | 360 |
| |
360 | 361 |
| |
| 362 | + | |
361 | 363 |
| |
362 | 364 |
| |
363 | 365 |
| |
|
Lines changed: 59 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
513 | 513 |
| |
514 | 514 |
| |
515 | 515 |
| |
| 516 | + | |
| 517 | + | |
516 | 518 |
| |
517 | 519 |
| |
518 | 520 |
| |
| |||
530 | 532 |
| |
531 | 533 |
| |
532 | 534 |
| |
| 535 | + | |
533 | 536 |
| |
534 | 537 |
| |
535 | 538 |
| |
| |||
1225 | 1228 |
| |
1226 | 1229 |
| |
1227 | 1230 |
| |
1228 |
| - | |
1229 |
| - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1230 | 1262 |
| |
1231 | 1263 |
| |
1232 | 1264 |
| |
| |||
1353 | 1385 |
| |
1354 | 1386 |
| |
1355 | 1387 |
| |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1356 | 1400 |
| |
1357 | 1401 |
| |
1358 | 1402 |
| |
| |||
1432 | 1476 |
| |
1433 | 1477 |
| |
1434 | 1478 |
| |
| 1479 | + | |
1435 | 1480 |
| |
1436 | 1481 |
| |
1437 | 1482 |
| |
1438 | 1483 |
| |
1439 | 1484 |
| |
1440 | 1485 |
| |
1441 |
| - | |
1442 |
| - | |
1443 | 1486 |
| |
1444 | 1487 |
| |
1445 | 1488 |
| |
| |||
1479 | 1522 |
| |
1480 | 1523 |
| |
1481 | 1524 |
| |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1482 | 1531 |
| |
1483 | 1532 |
| |
1484 | 1533 |
| |
| |||
1490 | 1539 |
| |
1491 | 1540 |
| |
1492 | 1541 |
| |
1493 |
| - | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
1494 | 1546 |
| |
1495 | 1547 |
| |
| 1548 | + | |
| 1549 | + | |
1496 | 1550 |
| |
1497 | 1551 |
| |
1498 | 1552 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1216 | 1216 |
| |
1217 | 1217 |
| |
1218 | 1218 |
| |
| 1219 | + | |
1219 | 1220 |
| |
1220 | 1221 |
| |
1221 | 1222 |
| |
| |||
8640 | 8641 |
| |
8641 | 8642 |
| |
8642 | 8643 |
| |
| 8644 | + | |
8643 | 8645 |
| |
8644 | 8646 |
| |
8645 | 8647 |
| |
| |||
18106 | 18108 |
| |
18107 | 18109 |
| |
18108 | 18110 |
| |
| 18111 | + | |
18109 | 18112 |
| |
18110 | 18113 |
| |
18111 | 18114 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1464 | 1464 |
| |
1465 | 1465 |
| |
1466 | 1466 |
| |
| 1467 | + | |
1467 | 1468 |
| |
1468 | 1469 |
| |
1469 | 1470 |
| |
| |||
1494 | 1495 |
| |
1495 | 1496 |
| |
1496 | 1497 |
| |
1497 |
| - | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
1498 | 1501 |
| |
1499 | 1502 |
| |
1500 | 1503 |
| |
| |||
1505 | 1508 |
| |
1506 | 1509 |
| |
1507 | 1510 |
| |
1508 |
| - | |
| 1511 | + | |
| 1512 | + | |
1509 | 1513 |
| |
1510 | 1514 |
| |
1511 | 1515 |
| |
| |||
1523 | 1527 |
| |
1524 | 1528 |
| |
1525 | 1529 |
| |
| 1530 | + | |
| 1531 | + | |
1526 | 1532 |
| |
1527 | 1533 |
| |
1528 | 1534 |
| |
| |||
1548 | 1554 |
| |
1549 | 1555 |
| |
1550 | 1556 |
| |
| 1557 | + | |
1551 | 1558 |
| |
1552 | 1559 |
| |
1553 | 1560 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
61 | 82 |
| |
62 | 83 |
| |
63 | 84 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
|
0 commit comments
Comments
(0)