forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2742c45
committed
expression eval: Reduce number of steps for agg transition invocations.
Do so by combining the various steps that are part of aggregatetransition function invocation into one larger step. As some of thecurrent steps are only necessary for some aggregates, have one variantof the aggregate transition step for each possible combination.To avoid further manual copies of code in the different transitionstep implementations, move most of the code into helper functionsmarked as "always inline".The benefit of this change is an increase in performance whenaggregating lots of rows. This comes in part due to the reduced numberof indirect jumps due to the reduced number of steps, and in part byreducing redundant setup code across steps. This mainly benefitsinterpreted execution, but the code generated by JIT is also improveda bit.As a nice side-effect it also ends up making the code a bit simpler.A small additional optimization is removing the need to setaggstate->curaggcontext before calling ExecAggInitGroup, choosing toinstead passign curaggcontext as an argument. It was, in contrast toother aggregate related functions, only needed to fetch a memorycontext to copy the transition value into.Author: Andres FreundDiscussion:https://postgr.es/m/20191023163849.sosqbfs5yenocez3@alap3.anarazel.dehttps://postgr.es/m/5c371df7cee903e8cd4c685f90c6c72086d3a2dc.camel@j-davis.com1 parent7d672b7 commit2742c45
File tree
5 files changed
+332
-348
lines changed- src
- backend
- executor
- jit/llvm
- include/executor
5 files changed
+332
-348
lines changedLines changed: 48 additions & 57 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3229 | 3229 |
| |
3230 | 3230 |
| |
3231 | 3231 |
| |
3232 |
| - | |
3233 |
| - | |
3234 | 3232 |
| |
3235 | 3233 |
| |
3236 | 3234 |
| |
| |||
3239 | 3237 |
| |
3240 | 3238 |
| |
3241 | 3239 |
| |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
3242 | 3244 |
| |
3243 | 3245 |
| |
3244 | 3246 |
| |
3245 | 3247 |
| |
3246 |
| - | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
3247 | 3271 |
| |
3248 |
| - | |
3249 |
| - | |
3250 |
| - | |
3251 |
| - | |
3252 |
| - | |
3253 |
| - | |
3254 |
| - | |
3255 |
| - | |
3256 |
| - | |
3257 |
| - | |
3258 |
| - | |
3259 |
| - | |
3260 |
| - | |
3261 |
| - | |
3262 |
| - | |
3263 |
| - | |
3264 |
| - | |
3265 |
| - | |
3266 |
| - | |
| 3272 | + | |
3267 | 3273 |
| |
3268 |
| - | |
3269 |
| - | |
3270 |
| - | |
3271 |
| - | |
3272 |
| - | |
3273 |
| - | |
3274 |
| - | |
3275 |
| - | |
3276 |
| - | |
3277 |
| - | |
3278 |
| - | |
3279 |
| - | |
3280 |
| - | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
3281 | 3294 |
| |
3282 |
| - | |
3283 |
| - | |
3284 |
| - | |
3285 |
| - | |
3286 |
| - | |
3287 |
| - | |
3288 | 3295 |
| |
3289 | 3296 |
| |
3290 | 3297 |
| |
| |||
3296 | 3303 |
| |
3297 | 3304 |
| |
3298 | 3305 |
| |
3299 |
| - | |
3300 |
| - | |
3301 |
| - | |
3302 |
| - | |
3303 |
| - | |
3304 |
| - | |
3305 |
| - | |
3306 |
| - | |
3307 |
| - | |
3308 |
| - | |
3309 |
| - | |
3310 |
| - | |
3311 |
| - | |
3312 |
| - | |
3313 |
| - | |
3314 |
| - | |
3315 | 3306 |
| |
3316 | 3307 |
| |
3317 | 3308 |
| |
|
0 commit comments
Comments
(0)