Eval expression R/O once time (src/backend/executor/execExpr.c)
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2021-09-21T18:09:11Z
Lists: pgsql-hackers
Attachments
- fix_eval_expr_once.patch (application/octet-stream) patch
Hi, Currently when determining where CoerceToDomainValue can be read, it evaluates every step in a loop. But, I think that the expression is immutable and should be solved only once. Otherwise the logic is wrong since by the rules of C, even though the variable is being initialized in the declaration, it still receives initialization at each repetition. What causes palloc running multiple times. In other words: Datum *domainval = NULL; is the same: Datum *domainval; domainval = NULL; Once there, reduce the scope for save_innermost_domainval and save_innermost_domainnull. Thoughts? regards, Ranier Vilela
Commits
-
Fix variable lifespan in ExecInitCoerceToDomain().
- ada667b45496 13.5 landed
- 16a56774fade 14.1 landed
- 01fc6527034a 15.0 landed
-
expression eval, jit: Minor code cleanups.
- 1ec7679f1b67 13.0 cited
-
Faster expression evaluation and targetlist projection.
- b8d7f053c5c2 10.0 cited