forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfe3caa1
committed
Remove size increase in ExprEvalStep caused by hashed saops
50e17ad increased the size of ExprEvalStep from 64 bytes up to 88 bytes.Lots of effort was spent during the development of the current expressionevaluation code to make an instance of this struct as small as possible.Making this struct larger than needed reduces CPU cache efficiency duringexpression evaluation which causes noticeable slowdowns during queryexecution.In order to reduce the size of the struct, here we remove the fn_addrfield. The values from this field can be obtained via fcinfo, just withsome extra pointer dereferencing. The extra indirection does not seem tocause any noticeable slowdowns.Various other fields have been moved into the ScalarArrayOpExprHashTablestruct. These fields are only used when the ScalarArrayOpExprHashTablepointer has already been dereferenced, so no additional pointerdereferences occur for these. Here we also make hash_fcinfo_data the lastfield in ScalarArrayOpExprHashTable so that we can avoid a further pointerdereference to get the FunctionCallInfoBaseData. This also saves a call topalloc().50e17ad was added in 14, but it's too late to adjust the size of theExprEvalStep in that version, so here we just backpatch to 15, which iscurrently in beta.Author: Andres Freund, David RowleyDiscussion:https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.deBackpatch-through: 151 parent16d52fc commitfe3caa1
File tree
3 files changed
+23
-29
lines changed- src
- backend/executor
- include/executor
3 files changed
+23
-29
lines changedLines changed: 1 addition & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1203 | 1203 |
| |
1204 | 1204 |
| |
1205 | 1205 |
| |
1206 |
| - | |
1207 |
| - | |
1208 | 1206 |
| |
1209 | 1207 |
| |
1210 | 1208 |
| |
| |||
1262 | 1260 |
| |
1263 | 1261 |
| |
1264 | 1262 |
| |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
1269 |
| - | |
1270 |
| - | |
1271 |
| - | |
1272 |
| - | |
1273 |
| - | |
1274 |
| - | |
1275 |
| - | |
1276 |
| - | |
1277 | 1263 |
| |
1278 | 1264 |
| |
1279 | 1265 |
| |
| |||
1292 | 1278 |
| |
1293 | 1279 |
| |
1294 | 1280 |
| |
1295 |
| - | |
| 1281 | + | |
1296 | 1282 |
| |
1297 |
| - | |
1298 |
| - | |
1299 |
| - | |
1300 | 1283 |
| |
1301 | 1284 |
| |
1302 | 1285 |
| |
|
Lines changed: 21 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
217 | 217 |
| |
218 | 218 |
| |
219 | 219 |
| |
| 220 | + | |
| 221 | + | |
220 | 222 |
| |
221 | 223 |
| |
222 | 224 |
| |
| |||
3474 | 3476 |
| |
3475 | 3477 |
| |
3476 | 3478 |
| |
3477 |
| - | |
| 3479 | + | |
3478 | 3480 |
| |
3479 | 3481 |
| |
3480 | 3482 |
| |
3481 | 3483 |
| |
3482 | 3484 |
| |
3483 |
| - | |
| 3485 | + | |
3484 | 3486 |
| |
3485 | 3487 |
| |
3486 | 3488 |
| |
| |||
3502 | 3504 |
| |
3503 | 3505 |
| |
3504 | 3506 |
| |
3505 |
| - | |
| 3507 | + | |
3506 | 3508 |
| |
3507 | 3509 |
| |
3508 | 3510 |
| |
| |||
3549 | 3551 |
| |
3550 | 3552 |
| |
3551 | 3553 |
| |
| 3554 | + | |
3552 | 3555 |
| |
3553 | 3556 |
| |
3554 | 3557 |
| |
| |||
3560 | 3563 |
| |
3561 | 3564 |
| |
3562 | 3565 |
| |
| 3566 | + | |
| 3567 | + | |
3563 | 3568 |
| |
3564 | 3569 |
| |
3565 | 3570 |
| |
| |||
3571 | 3576 |
| |
3572 | 3577 |
| |
3573 | 3578 |
| |
3574 |
| - | |
| 3579 | + | |
| 3580 | + | |
3575 | 3581 |
| |
3576 | 3582 |
| |
3577 | 3583 |
| |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
3578 | 3594 |
| |
3579 | 3595 |
| |
3580 | 3596 |
| |
| |||
3669 | 3685 |
| |
3670 | 3686 |
| |
3671 | 3687 |
| |
3672 |
| - | |
| 3688 | + | |
3673 | 3689 |
| |
3674 | 3690 |
| |
3675 | 3691 |
| |
|
Lines changed: 1 addition & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
584 | 584 |
| |
585 | 585 |
| |
586 | 586 |
| |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 |
| - | |
| 587 | + | |
593 | 588 |
| |
594 | 589 |
| |
595 | 590 |
| |
|
0 commit comments
Comments
(0)