- Notifications
You must be signed in to change notification settings - Fork28
Commit804163b
committed
Share transition state between different aggregates when possible.
If there are two different aggregates in the query with same inputs, andthe aggregates have the same initial condition and transition function,only calculate the state value once, and only call the final functionsseparately. For example, AVG(x) and SUM(x) aggregates have the sametransition function, which accumulates the sum and number of input tuples.For a query like "SELECT AVG(x), SUM(x) FROM x", we can thereforeaccumulate the state function only once, which gives a nice speedup.David Rowley, reviewed and edited by me.1 parentdee0200 commit804163b
File tree
8 files changed
+1132
-457
lines changed- src
- backend
- executor
- parser
- include
- nodes
- parser
- test/regress
- expected
- sql
8 files changed
+1132
-457
lines changedLines changed: 1 addition & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4487 | 4487 |
| |
4488 | 4488 |
| |
4489 | 4489 |
| |
4490 |
| - | |
4491 | 4490 |
| |
4492 | 4491 |
| |
4493 | 4492 |
| |
4494 | 4493 |
| |
4495 | 4494 |
| |
4496 | 4495 |
| |
4497 |
| - | |
4498 | 4496 |
| |
4499 | 4497 |
| |
4500 |
| - | |
4501 |
| - | |
4502 |
| - | |
4503 |
| - | |
4504 |
| - | |
4505 |
| - | |
4506 |
| - | |
4507 |
| - | |
4508 |
| - | |
4509 |
| - | |
4510 |
| - | |
4511 |
| - | |
4512 |
| - | |
4513 |
| - | |
4514 |
| - | |
4515 |
| - | |
4516 |
| - | |
4517 |
| - | |
4518 |
| - | |
| 4498 | + | |
4519 | 4499 |
| |
4520 | 4500 |
| |
4521 | 4501 |
| |
|
0 commit comments
Comments
(0)