aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-07-06 19:40:32 +1200
committerDavid Rowley <drowley@postgresql.org>2022-07-06 19:40:32 +1200
commitfe3caa1439378830d13423939b13e39d5afa8cf0 (patch)
tree80e0ed4c2dce7c2827c1f149dc5c1d174c96cf59 /src/backend/parser/parse_utilcmd.c
parent16d52fc89dbe8394ed318521e076f08fd2e4bf8c (diff)
downloadpostgresql-fe3caa1439378830d13423939b13e39d5afa8cf0.tar.gz
postgresql-fe3caa1439378830d13423939b13e39d5afa8cf0.zip
Remove size increase in ExprEvalStep caused by hashed saops
50e17ad28 increased the size of ExprEvalStep from 64 bytes up to 88 bytes. Lots of effort was spent during the development of the current expression evaluation code to make an instance of this struct as small as possible. Making this struct larger than needed reduces CPU cache efficiency during expression evaluation which causes noticeable slowdowns during query execution. In order to reduce the size of the struct, here we remove the fn_addr field. The values from this field can be obtained via fcinfo, just with some extra pointer dereferencing. The extra indirection does not seem to cause any noticeable slowdowns. Various other fields have been moved into the ScalarArrayOpExprHashTable struct. These fields are only used when the ScalarArrayOpExprHashTable pointer has already been dereferenced, so no additional pointer dereferences occur for these. Here we also make hash_fcinfo_data the last field in ScalarArrayOpExprHashTable so that we can avoid a further pointer dereference to get the FunctionCallInfoBaseData. This also saves a call to palloc(). 50e17ad28 was added in 14, but it's too late to adjust the size of the ExprEvalStep in that version, so here we just backpatch to 15, which is currently in beta. Author: Andres Freund, David Rowley Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de Backpatch-through: 15
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions