cockroachdb / cockroachdb/cockroach
opt: add rule to fold routines with multiple body statements
Open
A-sql-plpgsql
C-enhancement
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
It is common for the subroutines that implement a PLpgSQL routine to have one or more body statements that execute for side effects, with the last body statement simply returning the result of evaluating the nested routine. In these cases, it should be possible to fold the child into the parent subroutine by appending the child side-effecting body statements to those of the parent, and replacing the parent's last body statement with that of the child.
Jira issue: CRDB-34152
Contributor guide
Assessment
This issue has not been assessed yet.