SQLite Forum

Can this simple query be optimized?
It will be the last one visited that satisfied the aggregate.  That makes it 100% deterministic (meaning that if you do not change ANYTHING you will always get the same answer).

It may, however, be somewhat difficult to explain how exactly at any particular point in time for any particular set of circumstances this may be determined, so the answer to "which one" if the choices are multiple is "undefined" in order to avoid having to explain the complicated (but entirely deterministic) result, and to permit that behaviour to change in the future (that is, the particular row returned from amongst multiple choices is not specified in order that as long as one of them is returned, then which of them is not guaranteed).

In other words, it is fully deterministic, but not defined.