forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commiteae7be6
committed
Fix parallel-safety check of expressions and predicate for index builds
As coded, the planner logic that calculates the number of parallelworkers to use for a parallel index build uses expressions andpredicates from the relcache, which are flattened for the planner byeval_const_expressions().As reported in the bug, an immutable parallel-unsafe function flattenedin the relcache would become a Const, which would be considered asparallel-safe, even if the predicate or the expressions including thefunction are not safe in parallel workers. Depending on the expressionsor predicate used, this could cause the parallel build to fail.Tests are included that check parallel index builds with parallel-unsafepredicate and expressions. Two routines are added to lsyscache.h to beable to retrieve expressions and predicate of an index from its pg_indexdata.Reported-by: Alexander LakhinAuthor: Tender WangReviewed-by: Jian He, Michael PaquierDiscussion:https://postgr.es/m/CAHewXN=UaAaNn9ruHDH3Os8kxLVmtWqbssnf=dZN_s9=evHUFA@mail.gmail.comBackpatch-through: 121 parent3e76a80 commiteae7be6
File tree
5 files changed
+121
-2
lines changed- src
- backend
- optimizer/plan
- utils/cache
- include/utils
- test/regress
- expected
- sql
5 files changed
+121
-2
lines changedLines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6667 | 6667 |
| |
6668 | 6668 |
| |
6669 | 6669 |
| |
| 6670 | + | |
| 6671 | + | |
| 6672 | + | |
| 6673 | + | |
| 6674 | + | |
| 6675 | + | |
| 6676 | + | |
| 6677 | + | |
6670 | 6678 |
| |
6671 | 6679 |
| |
6672 |
| - | |
6673 |
| - | |
| 6680 | + | |
| 6681 | + | |
6674 | 6682 |
| |
6675 | 6683 |
| |
6676 | 6684 |
| |
|
Lines changed: 68 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3502 | 3502 |
| |
3503 | 3503 |
| |
3504 | 3504 |
| |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
3505 | 3573 |
| |
3506 | 3574 |
| |
3507 | 3575 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
| 198 | + | |
| 199 | + | |
198 | 200 |
| |
199 | 201 |
| |
200 | 202 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
434 | 434 |
| |
435 | 435 |
| |
436 | 436 |
| |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + |
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
267 | 267 |
| |
268 | 268 |
| |
269 | 269 |
| |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + |
0 commit comments
Comments
(0)