forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5748f3a
committed
Improve predtest.c's internal docs, and enhance its functionality a bit.
Commitb08df9c left things rather poorly documented as far as theexact semantics of "clause_is_check" mode went. Also, that mode didnot really work correctly for predicate_refuted_by; although given thelack of specification as to what it should do, as well as the lackof any actual use-case, that's perhaps not surprising.Rename "clause_is_check" to "weak" proof mode, and provide specificationsfor what it should do. I defined weak refutation as meaning "truth of Aimplies non-truth of B", which makes it possible to use the mode in thepart of relation_excluded_by_constraints that checks for mutuallycontradictory WHERE clauses. Fix up several places that did things wrongfor that definition. (As far as I can see, these errors would only leadto failure-to-prove, not incorrect claims of proof, making them notserious bugs even aside from the fact that v10 contains no use of thismode. So there seems no need for back-patching.)In addition, teach predicate_refuted_by_recurse that it can usepredicate_implied_by_recurse after all when processing a strong NOT-clause,so long as it asks for the correct proof strength. This is an optimizationthat could have been included in commitb08df9c, but wasn't.Also, simplify and generalize the logic that checks for whether nullness ofthe argument of IS [NOT] NULL would force overall nullness of the predicateor clause. (This results in a change in the partition_prune test's output,as it is now able to prune an all-nulls partition that it did not recognizebefore.)In passing, in PartConstraintImpliedByRelConstraint, remove bogusconversion of the constraint list to explicit-AND form and then right backagain; that accomplished nothing except forcing a useless extra level ofrecursion inside predicate_implied_by.Discussion:https://postgr.es/m/5983.1520487191@sss.pgh.pa.us1 parenta63c327 commit5748f3a
File tree
8 files changed
+364
-163
lines changed- src
- backend
- commands
- optimizer/util
- include/optimizer
- test
- modules/test_predtest
- expected
- sql
- regress
- expected
- sql
8 files changed
+364
-163
lines changedLines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13651 | 13651 |
| |
13652 | 13652 |
| |
13653 | 13653 |
| |
13654 |
| - | |
| 13654 | + | |
13655 | 13655 |
| |
13656 |
| - | |
13657 |
| - | |
| 13656 | + | |
| 13657 | + | |
| 13658 | + | |
13658 | 13659 |
| |
13659 | 13660 |
| |
13660 | 13661 |
| |
| |||
13724 | 13725 |
| |
13725 | 13726 |
| |
13726 | 13727 |
| |
13727 |
| - | |
13728 |
| - | |
13729 |
| - | |
13730 |
| - | |
| 13728 | + | |
| 13729 | + | |
| 13730 | + | |
| 13731 | + | |
| 13732 | + | |
| 13733 | + | |
| 13734 | + | |
| 13735 | + | |
| 13736 | + | |
13731 | 13737 |
| |
13732 | 13738 |
| |
13733 | 13739 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1421 | 1421 |
| |
1422 | 1422 |
| |
1423 | 1423 |
| |
1424 |
| - | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1425 | 1429 |
| |
1426 | 1430 |
| |
1427 | 1431 |
| |
| |||
1469 | 1473 |
| |
1470 | 1474 |
| |
1471 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1472 | 1479 |
| |
1473 | 1480 |
| |
1474 | 1481 |
| |
|
0 commit comments
Comments
(0)