forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0927d2f
committed
Let Parallel Append over simple UNION ALL have partial subpaths.
A simple UNION ALL gets flattened into an appendrel of subqueryRTEs, but up until now it's been impossible for the appendrel to usethe partial paths for the subqueries, so we can implement theappendrel as a Parallel Append but only one with non-partial pathsas children.There are three separate obstacles to removing that limitation.First, when planning a subquery, propagate any partial paths to thefinal_rel so that they are potentially visible to outer query levels(but not if they have initPlans attached, because that wouldn't besafe). Second, after planning a subquery, propagate any partial pathsfor the final_rel to the subquery RTE in the outer query level in thesame way we do for non-partial paths. Third, teach finalize_plan() toaccount for the possibility that the fake parameter we use for rescansignalling when the plan contains a Gather (Merge) node may bepropagated from an outer query level.Patch by me, reviewed and tested by Amit Khandekar, RajkumarRaghuwanshi, and Ashutosh Bapat. Test cases based on examples byRajkumar Raghuwanshi.Discussion:http://postgr.es/m/CA+Tgmoa6L9A1nNCk3aTDVZLZ4KkHDn1+tm7mFyFvP+uQPS7bAg@mail.gmail.com1 parentd04900d commit0927d2f
File tree
5 files changed
+143
-2
lines changed- src
- backend/optimizer
- path
- plan
- test/regress
- expected
- sql
5 files changed
+143
-2
lines changedLines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2179 | 2179 |
| |
2180 | 2180 |
| |
2181 | 2181 |
| |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
2182 | 2204 |
| |
2183 | 2205 |
| |
2184 | 2206 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2194 | 2194 |
| |
2195 | 2195 |
| |
2196 | 2196 |
| |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
2197 | 2213 |
| |
2198 | 2214 |
| |
2199 | 2215 |
| |
|
Lines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2202 | 2202 |
| |
2203 | 2203 |
| |
2204 | 2204 |
| |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2205 | 2212 |
| |
2206 | 2213 |
| |
2207 | 2214 |
| |
| |||
2407 | 2414 |
| |
2408 | 2415 |
| |
2409 | 2416 |
| |
| 2417 | + | |
2410 | 2418 |
| |
2411 |
| - | |
| 2419 | + | |
2412 | 2420 |
| |
2413 |
| - | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
2414 | 2427 |
| |
2415 | 2428 |
| |
2416 | 2429 |
| |
|
Lines changed: 65 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
890 | 890 |
| |
891 | 891 |
| |
892 | 892 |
| |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
893 | 958 |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
358 | 358 |
| |
359 | 359 |
| |
360 | 360 |
| |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
361 | 386 |
|
0 commit comments
Comments
(0)