Commit 3022bf6
Split mixed const/runtime AND-terms in constWhereClause
mergeConstIntoPostJoinWhereClause now flattens the AND-tree and
classifies each conjunct independently. Compile-time constant terms
(e.g. 1 > 10) stay in constWhereClause for EmptyTableRecordCursorFactory
folding; runtime terms (e.g. NOW() = NOW()) move to postJoinWhereClause.
Previously, a mixed expression like (1 > 10 AND NOW() = NOW()) was
treated as a single non-compile-time block, losing the Empty table
optimization.
Adds extractAndTerms() and isCompileTimeConstant() static helpers.
Adds tests for mixed false+runtime, true+runtime, and plan assertions.
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent e38830c commit 3022bf6
File tree
3 files changed
+121
-15
lines changed- core/src
- main/java/io/questdb/griffin
- test/java/io/questdb/test/griffin
- engine/join
3 files changed
+121
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
410 | 434 | | |
411 | 435 | | |
412 | 436 | | |
| |||
1666 | 1690 | | |
1667 | 1691 | | |
1668 | 1692 | | |
| 1693 | + | |
1669 | 1694 | | |
1670 | 1695 | | |
1671 | 1696 | | |
| |||
4525 | 4550 | | |
4526 | 4551 | | |
4527 | 4552 | | |
4528 | | - | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
4529 | 4572 | | |
4530 | 4573 | | |
4531 | 4574 | | |
4532 | 4575 | | |
4533 | | - | |
| 4576 | + | |
4534 | 4577 | | |
4535 | 4578 | | |
4536 | | - | |
| 4579 | + | |
4537 | 4580 | | |
4538 | | - | |
4539 | 4581 | | |
4540 | 4582 | | |
4541 | 4583 | | |
4542 | | - | |
4543 | | - | |
4544 | | - | |
4545 | | - | |
4546 | | - | |
4547 | | - | |
4548 | | - | |
4549 | | - | |
4550 | | - | |
4551 | | - | |
4552 | | - | |
4553 | 4584 | | |
4554 | 4585 | | |
4555 | 4586 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4942 | 4942 | | |
4943 | 4943 | | |
4944 | 4944 | | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
4945 | 4961 | | |
4946 | 4962 | | |
4947 | 4963 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2893 | 2893 | | |
2894 | 2894 | | |
2895 | 2895 | | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
2896 | 2955 | | |
2897 | 2956 | | |
2898 | 2957 | | |
| |||
0 commit comments