- Notifications
You must be signed in to change notification settings - Fork5
Commitb746d0c
committed
Fix old bug in get_loop_count().
While poking at David Kubečka's issue I noticed an ancient logic errorin get_loop_count(): it used 1.0 as a "no data yet" indicator, but sincethat is actually a valid rowcount estimate, this doesn't work. If wehave one input relation with 1.0 as rowcount and then another one witha larger rowcount, we should use 1.0 as the result, but we picked thelarger rowcount instead. (I think when I coded this, I recognized theconflict, but mistakenly thought that the logic would pick the desiredcount anyway.)Fixing this changed the plan for one existing regression test case.Since the point of that test is to exercise creation of a particularshape of nestloop plan, I tweaked the query a little bit so it stillresults in the same plan choice.This is definitely a bug, but I'm hesitant to back-patch since it mightchange plan choices unexpectedly, and anyway failure to implement aheuristic precisely as intended is a pretty low-grade bug.1 parentb557226 commitb746d0c
File tree
3 files changed
+9
-8
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+9
-8
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1886 | 1886 |
| |
1887 | 1887 |
| |
1888 | 1888 |
| |
1889 |
| - | |
| 1889 | + | |
1890 | 1890 |
| |
1891 | 1891 |
| |
1892 | 1892 |
| |
| |||
1915 | 1915 |
| |
1916 | 1916 |
| |
1917 | 1917 |
| |
1918 |
| - | |
| 1918 | + | |
1919 | 1919 |
| |
1920 | 1920 |
| |
1921 |
| - | |
| 1921 | + | |
| 1922 | + | |
1922 | 1923 |
| |
1923 | 1924 |
| |
1924 | 1925 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3074 | 3074 |
| |
3075 | 3075 |
| |
3076 | 3076 |
| |
3077 |
| - | |
| 3077 | + | |
3078 | 3078 |
| |
3079 | 3079 |
| |
3080 | 3080 |
| |
3081 | 3081 |
| |
3082 | 3082 |
| |
3083 | 3083 |
| |
3084 |
| - | |
| 3084 | + | |
3085 | 3085 |
| |
3086 | 3086 |
| |
3087 | 3087 |
| |
| |||
3092 | 3092 |
| |
3093 | 3093 |
| |
3094 | 3094 |
| |
3095 |
| - | |
| 3095 | + | |
3096 | 3096 |
| |
3097 | 3097 |
| |
3098 | 3098 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
880 | 880 |
| |
881 | 881 |
| |
882 | 882 |
| |
883 |
| - | |
| 883 | + | |
884 | 884 |
| |
885 | 885 |
| |
886 | 886 |
| |
887 |
| - | |
| 887 | + | |
888 | 888 |
| |
889 | 889 |
| |
890 | 890 |
| |
|
0 commit comments
Comments
(0)