forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit51b2f8b

Neil Conway
This patch changes int2_avg_accum() and int4_avg_accum() use the nodeAgg
performance hack Tom introduced recently. This means we can avoidcopying the transition array for each input tuple if these functionsare invoked as aggregate transition functions.To test the performance improvement, I created a 1 million row tablewith a single int4 column. Without the patch, SELECT avg(col) FROMtable took about 4.2 seconds (after the data was cached); with thepatch, it took about 3.2 seconds. Naturally, the performanceimprovement for a less trivial query (or a table with wider rows)would be relatively smaller.1 parent8bbe905 commit51b2f8b
1 file changed
+21
-7
lines changedLines changed: 21 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| |||
2462 | 2462 |
| |
2463 | 2463 |
| |
2464 | 2464 |
| |
2465 |
| - | |
| 2465 | + | |
2466 | 2466 |
| |
2467 | 2467 |
| |
2468 | 2468 |
| |
2469 | 2469 |
| |
2470 |
| - | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
2471 | 2473 |
| |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
2472 | 2479 |
| |
2473 | 2480 |
| |
2474 |
| - | |
2475 | 2481 |
| |
| 2482 | + | |
2476 | 2483 |
| |
2477 | 2484 |
| |
2478 | 2485 |
| |
| |||
2482 | 2489 |
| |
2483 | 2490 |
| |
2484 | 2491 |
| |
2485 |
| - | |
| 2492 | + | |
2486 | 2493 |
| |
2487 | 2494 |
| |
2488 | 2495 |
| |
2489 | 2496 |
| |
2490 |
| - | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
2491 | 2500 |
| |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2492 | 2506 |
| |
2493 | 2507 |
| |
2494 |
| - | |
2495 | 2508 |
| |
| 2509 | + | |
2496 | 2510 |
| |
2497 | 2511 |
| |
2498 | 2512 |
| |
|
0 commit comments
Comments
(0)