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"?
Jeff > On May 29, 2017, at 8:51 AM, Richard Hipp <d...@sqlite.org> wrote: > > It is true that SQLite could compute 2+2 and store the result then > copy the result into the result register for each result row, but > doing the copy is not measurably faster than simply redoing the 2+2 > computation. > > You will notice that in a more complex computation like: > > SELECT 2*15-5+11/5<<3*1 FROM tbl > > That the "2*15-5+11/5" and "3*1" subexpressions are computed just > once, and only the final "<<" operator is repeated for each row. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users