forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit3570ea4
committed
Fix improper repetition of previous results from a hashed aggregate.
ExecReScanAgg's check for whether it could re-use a previously calculatedhashtable neglected the possibility that the Agg node might referencePARAM_EXEC Params that are not referenced by its input plan node. That'sokay if the Params are in upper tlist or qual expressions; but if oneappears in aggregate input expressions, then the hashtable contents needto be recomputed when the Param's value changes.To avoid unnecessary performance degradation in the case of a Param thatisn't within an aggregate input, add logic to the planner to determinewhich Params are within aggregate inputs. This requires a new field instruct Agg, but fortunately we never write plans to disk, so this isn'tan initdb-forcing change.Per report from Jeevan Chalke. This has been broken since forever,so back-patch to all supported branches.Andrew Gierth, with minor adjustments by meReport: <CAM2+6=VY8ykfLT5Q8vb9B6EbeBk-NGuLbT6seaQ+Fq4zXvrDcA@mail.gmail.com>1 parent9942376 commit3570ea4
File tree
8 files changed
+102
-7
lines changed- src
- backend
- executor
- nodes
- optimizer/plan
- include/nodes
- test/regress
- expected
- sql
8 files changed
+102
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1905 | 1905 | | |
1906 | 1906 | | |
1907 | 1907 | | |
| 1908 | + | |
1908 | 1909 | | |
1909 | 1910 | | |
1910 | 1911 | | |
1911 | 1912 | | |
1912 | 1913 | | |
1913 | 1914 | | |
1914 | | - | |
| 1915 | + | |
1915 | 1916 | | |
1916 | 1917 | | |
1917 | 1918 | | |
| |||
1923 | 1924 | | |
1924 | 1925 | | |
1925 | 1926 | | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1929 | 1931 | | |
1930 | | - | |
| 1932 | + | |
| 1933 | + | |
1931 | 1934 | | |
1932 | 1935 | | |
1933 | 1936 | | |
| |||
1964 | 1967 | | |
1965 | 1968 | | |
1966 | 1969 | | |
1967 | | - | |
| 1970 | + | |
1968 | 1971 | | |
1969 | 1972 | | |
1970 | 1973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
772 | 773 | | |
773 | 774 | | |
774 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| 645 | + | |
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3940 | 3940 | | |
3941 | 3941 | | |
3942 | 3942 | | |
| 3943 | + | |
3943 | 3944 | | |
3944 | 3945 | | |
3945 | 3946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
2351 | 2352 | | |
2352 | 2353 | | |
2353 | 2354 | | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
2354 | 2378 | | |
2355 | 2379 | | |
2356 | 2380 | | |
| |||
2359 | 2383 | | |
2360 | 2384 | | |
2361 | 2385 | | |
2362 | | - | |
2363 | 2386 | | |
2364 | 2387 | | |
2365 | 2388 | | |
| |||
2503 | 2526 | | |
2504 | 2527 | | |
2505 | 2528 | | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
2506 | 2551 | | |
2507 | 2552 | | |
2508 | 2553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
| 608 | + | |
607 | 609 | | |
608 | 610 | | |
609 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
308 | 340 | | |
309 | 341 | | |
310 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| |||
0 commit comments
Comments
(0)