sql: remove redundant goto from VDBE prologue
Structure of VDBE prologue: 0: OP_Init 0 N (address to start) 0 --| |-> 1: ... | | ... | | N: OP_Transaction <------------ | N+1: (Constant expressions to be saved in registers) | ... |-- M: OP_Goto 0 1 0 However, last opcode in VDBE program (i.e. OP_Goto) is generated always, despite the existence of OP_Transaction or constant expressions. Thus, VDBE program for queries like <SELECT * FROM table;> features redundant jump. Such useless jump wastes exectuion time (although it is executed once) and may affect jump prediction. This patch adds conditional branch for generating jump opcode finishing VDBE program: it is appended only if we need to start transaction or code constrant expressions. Closes #3231
Loading
Please register or sign in to comment