optimize code generated for select statements
Submitted by Kristof Szabados
Link to original bug (#500062)
Description
The code generated for select statements could be optimized in 2 steps, compared to the current version:
- According to the standard the expression in the select header only needs to be executed once, and the result can be saved.
We could extract it into a temporal variable to speed up execution.
When the case branches do not overlap we could generate a switch, further optimizing the execution.
Version: 5.5.0