forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdfdf07a
committed
Fix up LIMIT/OFFSET planning so that we cope with non-constant LIMIT
or OFFSET clauses by using estimate_expression_value(). The main advantageof this is that if the expression is a Param and we have a value for theParam, we'll use that value rather than defaulting. Also, fix somethinkos in the logic for combining LIMIT/OFFSET with an externallysupplied tuple fraction (this covers cases like EXISTS(...LIMIT...)).And make sure the results of all this are shown by EXPLAIN. Per agripe from Merlin Moncure.1 parent96f63ae commitdfdf07a
File tree
4 files changed
+201
-101
lines changed- src
- backend/optimizer/plan
- include/optimizer
4 files changed
+201
-101
lines changedLines changed: 48 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
2673 | 2673 |
| |
2674 | 2674 |
| |
2675 | 2675 |
| |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
2676 | 2683 |
| |
2677 |
| - | |
| 2684 | + | |
| 2685 | + | |
2678 | 2686 |
| |
2679 | 2687 |
| |
2680 | 2688 |
| |
2681 | 2689 |
| |
2682 | 2690 |
| |
2683 | 2691 |
| |
2684 | 2692 |
| |
2685 |
| - | |
2686 |
| - | |
2687 |
| - | |
2688 |
| - | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
2689 | 2700 |
| |
2690 |
| - | |
| 2701 | + | |
2691 | 2702 |
| |
2692 |
| - | |
2693 |
| - | |
| 2703 | + | |
2694 | 2704 |
| |
2695 |
| - | |
2696 |
| - | |
2697 |
| - | |
2698 |
| - | |
2699 |
| - | |
2700 |
| - | |
2701 |
| - | |
2702 |
| - | |
2703 |
| - | |
2704 |
| - | |
2705 |
| - | |
2706 |
| - | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
2707 | 2718 |
| |
2708 |
| - | |
| 2719 | + | |
| 2720 | + | |
2709 | 2721 |
| |
2710 |
| - | |
2711 |
| - | |
| 2722 | + | |
2712 | 2723 |
| |
2713 |
| - | |
2714 |
| - | |
2715 |
| - | |
2716 |
| - | |
2717 |
| - | |
2718 |
| - | |
2719 |
| - | |
2720 |
| - | |
2721 |
| - | |
2722 |
| - | |
2723 |
| - | |
2724 |
| - | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
2725 | 2737 |
| |
2726 | 2738 |
| |
2727 | 2739 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
519 | 519 |
| |
520 | 520 |
| |
521 | 521 |
| |
522 |
| - | |
| 522 | + | |
| 523 | + | |
523 | 524 |
| |
524 | 525 |
| |
525 | 526 |
| |
|
0 commit comments
Comments
(0)