On 5/29/17, Jeffrey Mattox <[email protected]> wrote: > Why does a complex computation (but still consisting of only constants) make > a difference as to whether the computation is performed once or many times? > What's the dividing line between "simple" and "complex"?
The dividing line is the number of opcode need to implement the computation. If the number is 1, then the computation is "simple". Two are more opcodes and the computation is "complex". The query planner factors all but the very last opcode or the expression out of the inner loop. The very last opcode of the expression is retained in the inner loop in order to refresh the result. -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

