Commit 4cad253
committed
Use CP_SMALL_TLIST for hash aggregate
Commit 1f39bce added disk-based hash aggregation, which may spill
incoming tuples to disk. It however did not request projection to make
the tuples as narrow as possible, which may mean having to spill much
more data than necessary (increasing I/O, pushing other stuff from page
cache, etc.).
This adds CP_SMALL_TLIST in places that may use hash aggregation - we do
that only for AGG_HASHED. It's unnecessary for AGG_SORTED, because that
either uses explicit Sort (which already does projection) or pre-sorted
input (which does not need spilling to disk).
Author: Tomas Vondra
Reviewed-by: Jeff Davis
Discussion: https://postgr.es/m/20200519151202.u2p2gpiawoaznsv2%40development1 parent 9b60c4b commit 4cad253
File tree
2 files changed
+26
-6
lines changed- contrib/postgres_fdw/expected
- src/backend/optimizer/plan
2 files changed
+26
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2715 | 2715 | | |
2716 | 2716 | | |
2717 | 2717 | | |
2718 | | - | |
| 2718 | + | |
2719 | 2719 | | |
2720 | 2720 | | |
2721 | 2721 | | |
| |||
2964 | 2964 | | |
2965 | 2965 | | |
2966 | 2966 | | |
2967 | | - | |
| 2967 | + | |
2968 | 2968 | | |
2969 | 2969 | | |
2970 | 2970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2113 | 2113 | | |
2114 | 2114 | | |
2115 | 2115 | | |
| 2116 | + | |
2116 | 2117 | | |
2117 | 2118 | | |
2118 | 2119 | | |
2119 | | - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
2120 | 2124 | | |
2121 | | - | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
2122 | 2132 | | |
2123 | 2133 | | |
2124 | 2134 | | |
| |||
2200 | 2210 | | |
2201 | 2211 | | |
2202 | 2212 | | |
| 2213 | + | |
2203 | 2214 | | |
2204 | 2215 | | |
2205 | 2216 | | |
2206 | 2217 | | |
2207 | 2218 | | |
2208 | 2219 | | |
2209 | 2220 | | |
2210 | | - | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
2211 | 2225 | | |
2212 | | - | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
2213 | 2233 | | |
2214 | 2234 | | |
2215 | 2235 | | |
| |||
0 commit comments